1

so I just recently started to get the following warning in my console:

"Source map error: request failed with status 404" resource URL: http://127.0.0.1:8000/js/app.js map resource URL: shvl.es.js.map"

Anyone ever experienced this before? I don't know what this could be?

My webpack file:

let mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css');

5
  • How do you run your app. are you using any module bundler ( webpack , parcel etc ). Commented Nov 6, 2018 at 12:14
  • yeah I'm using laravel's webpax mix Commented Nov 6, 2018 at 12:28
  • Share your webpack configuration. Commented Nov 6, 2018 at 12:35
  • I added my webpack.mix.js file Commented Nov 6, 2018 at 12:37
  • I have added an answer. go through it. Commented Nov 6, 2018 at 12:46

1 Answer 1

5

Enable/Disable source maps can be handle by providing config mix.sourceMaps(!mix.inProduction()).

Make sure in development mode is enabled.

Updated mix configuration file

let mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css')
  .sourceMaps(!mix.inProduction())
Sign up to request clarification or add additional context in comments.

6 Comments

I updated my mix file but I'm still getting the warning
Did you check this value mix.inProduction or instead run with true in dev mode.
I tried with .sourceMaps(!mix.inProduction) and .sourceMaps(mix.inProduction)
mix.inProduction is a function not a variable. Use mix.inProduction()
I fixed the warning appending .sourceMaps();
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.