Laravel-mix: webpack-dev-server outputPath error

Created on 24 Jan 2017  ยท  22Comments  ยท  Source: JeffreyWay/laravel-mix

On command npm run hot I'm getting this error:

ERROR in [copy-webpack-plugin] Using older versions of webpack-dev-server, devServer.outputPath must be defined to write to absolute paths

Most helpful comment

Still having same problem with version:

$npm list webpack-dev-server
/home/sergi/Code/scool/curriculum_test
โ””โ”€โ”ฌ [email protected]
  โ””โ”€โ”€ [email protected] 

@JeffreyWay please I think you have to reopen this issue

All 22 comments

We've updated webpack-dev-server on master. It'll be tagged later today.

Thanks. ๐Ÿ‘

@zgabievi does it work for you now? I still get the same error

I'm not getting error now. It's working, but not for laravel project. In browser (http://localhost:8080), I'm getting this output Cannot GET /

@zgabievi try using laravel valet.

@zgabievi webpack-dev-server doesn't serve your Laravel app, only your assets. Use the mix() helper provided with Laravel. https://github.com/JeffreyWay/laravel-mix/blob/master/docs/hot-module-replacement.md#usage-in-laravel

@jbreuer95 I'am using Valet.

@adriaanzon Yes, I'm using mix() helper for assets

It doesn't work when you visit your site the normal way? i.e. via site.dev, not via localhost:8080

Still having same problem with version:

$npm list webpack-dev-server
/home/sergi/Code/scool/curriculum_test
โ””โ”€โ”ฌ [email protected]
  โ””โ”€โ”€ [email protected] 

@JeffreyWay please I think you have to reopen this issue

I get this error if I have a mix.copy() command in my webpack.mix.js, like this:

mix.copy('node_modules/vue/dist/vue.min.js', 'public/js' )

When I comment that out, it goes away.

The full error is:

chunk    {0} /js/app.js, /css/app.css (/js/app) 1.5 MB [entry] [rendered]
   [55] (webpack)/hot/emitter.js 77 bytes {0} [built]
   [56] ./resources/assets/js/app.js 1.52 kB {0} [built]
   [57] ./resources/assets/sass/app.scss 41 bytes {0} [built]
   [58] (webpack)-dev-server/client?http://localhost:8080 4.66 kB {0} [built]
   [59] (webpack)/hot/dev-server.js 1.57 kB {0} [built]
   [85] ./resources/assets/js/bootstrap.js 1.31 kB {0} [built]
   [86] ./resources/assets/js/vuex/store.js 13.7 kB {0} [built]
  [126] ./~/url/url.js 23.3 kB {0} [built]
  [128] ./resources/assets/js/components/CollationColumn.vue 1.65 kB {0} [built]
  [129] ./resources/assets/js/components/CollationInfo.vue 1.64 kB {0} [built]
  [130] ./resources/assets/js/components/CollationItemSearchModal.vue 1.69 kB {0} [built]
  [131] ./resources/assets/js/components/CollationLine.vue 1.64 kB {0} [built]
  [146] (webpack)-dev-server/client/socket.js 856 bytes {0} [built]
  [148] (webpack)/hot/log-apply-result.js 1.02 kB {0} [built]
  [149] multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./resources/assets/js/app.js ./resources/assets/sass/app.scss 64 bytes {0} [built]
     + 135 hidden modules

ERROR in [copy-webpack-plugin] Using older versions of webpack-dev-server, devServer.outputPath must be defined to write to absolute paths
Child extract-text-webpack-plugin:
    chunk    {0} extract-text-webpack-plugin-output-filename 698 kB [entry] [rendered]
        [0] ./~/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.eot 92 bytes {0} [built]
        [1] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
        [2] ./~/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.svg 92 bytes {0} [built]
        [3] ./~/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf 92 bytes {0} [built]
        [4] ./~/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.woff 93 bytes {0} [built]
        [5] ./~/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 94 bytes {0} [built]
        [6] ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap&precision=8!./resources/assets/sass/app.scss 696 kB {0} [built]

Same here

Alt text

This is still happening on a fresh installation of Laravel Spark.

Make sure you have the latest version of Mix installed.

Indeed I have. 0.8.8.

Same thing here

@JeffreyWay Do you use [chunkhash] in conjunction with webpack-dev-server --hot --inline?
As I understand, this combination is not compatible.

Same here. I'm using a fresh instalation of Laravel Spark via composer.

error

Any progress on this or is there any fix? Fresh install of spark, this fails out of the box.

Same here. IMO https://github.com/kevlened/copy-webpack-plugin/issues/44 requires a now invalid option

Invalid configuration object. webpack-dev-server has been initialised using a configuration object that does not
match the API schema.
 - configuration has an unknown property 'outputPath'. These properties are valid:
   object { hot?, hotOnly?, lazy?, host?, filename?, publicPath?, port?, socket?, watchOptions?, headers?, client
LogLevel?, overlay?, key?, cert?, ca?, pfx?, pfxPassphrase?, inline?, public?, https?, contentBase?, watchContent
Base?, open?, features?, compress?, proxy?, historyApiFallback?, staticOptions?, setup?, stats?, reporter?, noInf
o?, quiet?, serverSideRender?, index?, log?, warn? }

Breaks devserver reload badly, no workaround?!

Using "laravel-mix": "^0.10.0" and having the same issue.

My temporary solution is to wrap the mix.copy entries in a condition, as follows:

if (mix.config.inProduction) {
    mix.copy('node_modules/bootstrap/fonts', 'public/fonts');
}

Of course, to have the assets copied, it is required to use npm run production once.

Fixed in 329ed0ccffb51d52111ec11359f2617c528c60c0

Fantastic! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cheddam picture Cheddam  ยท  3Comments

Micaso picture Micaso  ยท  3Comments

rderimay picture rderimay  ยท  3Comments

jpmurray picture jpmurray  ยท  3Comments

stefensuhat picture stefensuhat  ยท  3Comments