源映射错误:请求失败,状态为 404 资源 URL:http://{mywebsite}/js/app.js 源映射 URL:bootstrap.js.map-laravel-Vue
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49726204/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Source map error: request failed with status 404 Resource URL: http://{mywebsite}/js/app.js Source Map URL: bootstrap.js.map-laravel-Vue
提问by Biswas Sampad
While posting the posts i am getting the above error on web consol.
在发布帖子时,我在网络控制台上收到上述错误。
Source map error: request failed with status 404 Resource Resource URL: http://{mywebsite}/js/app.js Source Map URL: bootstrap.js.map
源映射错误:请求失败,状态为 404 资源资源 URL:http://{mywebsite}/js/app.js 源映射 URL:bootstrap.js.map
My resourcses/js/app.js looks like this
我的 resourcses/js/app.js 看起来像这样
[const app = new Vue({
el: '#app',
data: {
msg: 'Update new Post:',
content:'',
},
methods:{
addPost(){
axios.post('myid.web/home/addPost', {
content:this.content
})
.then(function(response){
console.log(response);
})
.catch(function(error){
console.log(error);
});
}
}
});][1]
And the webpack.js looks like this
webpack.js 看起来像这样
let mix = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
回答by Christian
I had the same issue and followed Biswas comment. Go to your webpack.mix.js and change
我遇到了同样的问题,并遵循了 Biswas 的评论。转到您的 webpack.mix.js 并更改
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
to
到
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.sourceMaps();