webpack / webpack-with-common-libs

webpack with some common libraries
MIT License
340 stars 105 forks source link

fix crash of dev server middleware #6

Closed geekflyer closed 9 years ago

geekflyer commented 9 years ago

Hi, when lazy is not set, starting the dev server wil fail / crash with:

[02:13:10] Error: Invalid path ''
    at pathToArray (/Users/d061084/dev/pdms-fdn/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:23:38)
    at MemoryFileSystem.mkdirpSync (/Users/d061084/dev/pdms-fdn/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:107:13)
    at MemoryFileSystem.(anonymous function) [as mkdirp] (/Users/d061084/dev/pdms-fdn/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:187:34)
    at Tapable.<anonymous> (/Users/d061084/dev/pdms-fdn/node_modules/webpack/lib/Compiler.js:225:25)
    at Tapable.applyPluginsAsync (/Users/d061084/dev/pdms-fdn/node_modules/webpack/node_modules/tapable/lib/Tapable.js:60:69)
    at Tapable.Compiler.emitAssets (/Users/d061084/dev/pdms-fdn/node_modules/webpack/lib/Compiler.js:222:7)
    at Watching.<anonymous> (/Users/d061084/dev/pdms-fdn/node_modules/webpack/lib/Compiler.js:53:18)
    at /Users/d061084/dev/pdms-fdn/node_modules/webpack/lib/Compiler.js:397:12
    at Tapable.next (/Users/d061084/dev/pdms-fdn/node_modules/webpack/node_modules/tapable/lib/Tapable.js:69:11)
    at CachePlugin.<anonymous> (/Users/d061084/dev/pdms-fdn/node_modules/webpack/lib/CachePlugin.js:40:4)

I don't exactly understand why lazy false doesn't work. @sokra Could you have a look at this?

In case lazy is always required, we should also update the docs here: http://webpack.github.io/docs/usage-with-gulp.html to mention that. There are other people facing the same problem / bug and fixed it with lazy:

https://gitter.im/webpack/webpack/archives/2014/11/12

Best Regards Chris

sokra commented 9 years ago

lazy is not required and not recommended.

Maybe there is something wrong with your configuration. Did you set output.path to i. e. "/"?