"Error: invalid argument at pathToArray" with multi entrypoints and DDL configuration
damianobarbati opened this issue · comments
Hey @glenjamin, I keep getting the following error:
Error: invalid argument
0|react-ap | at pathToArray (/Users/damz/Desktop/react-app/node_modules/memory-fs/lib/MemoryFileSystem.js:44:10)
0|react-ap | at MemoryFileSystem.mkdirpSync (/Users/damz/Desktop/react-app/node_modules/memory-fs/lib/MemoryFileSystem.js:139:13)
0|react-ap | at MemoryFileSystem.(anonymous function) [as mkdirp] (/Users/damz/Desktop/react-app/node_modules/memory-fs/lib/MemoryFileSystem.js:279:34)
0|react-ap | at asyncLib.forEach (/Users/damz/Desktop/react-app/node_modules/webpack/lib/LibManifestPlugin.js:55:31)
In this setup https://github.com/damianobarbati/react-app/tree/hotreload when developing I have my webpack config exporting an array with:
- dll bundles
- app bundles (which requires dll bundles)
I followed the steps mentioned in the README with no luck, here what I did differently from master branch:
- add entry: https://github.com/damianobarbati/react-app/blob/hotreload/package.json#L39
- add hotmodule plugin: https://github.com/damianobarbati/react-app/blob/hotreload/config/webpack.config.js#L177
- apply the middleware https://github.com/damianobarbati/react-app/blob/hotreload/index.js#L29
Repro:
git clone https://github.com/damianobarbati/react-app/tree/hotreload
git checkout hotreload
yarn build:dev #run webpack build
yarn serve:dev #run koa server
pm2 logs #watch server logs
I'm totally stuck on this, can anybody help me?
I don’t really have time to look into this, but my initial advice would be to try using the normal command line compiler and see if you get the same error - which is usually the case - then you’ll know the issue is a general webpack config problem
@glenjamin thanks for replying.
I don't quite get what you mean with "try using the normal command line compiler".
Do I have to not fire webpack separately when using webpack-hot-middleware
?
I thought the reason for this module was to have a separate webpack running instance and a separate web server working together.
Furthermore if webpack-hot-middleware
was launching its own webpack instance whenever the server is restarted/reloaded because of back-end files modifications then webpack would be restarted along with it.
I'm pretty confused now.
BTW: firing webpack
as always (from command line) works flawlessly, even with this modifications I listed.
Using the command line compiler was just a debugging suggestion, many of the issues posted here happen regardless of the hot-middleware setup. By running without the server often we can rule out the server as the cause.
Do you still get the error if you omit hot-middleware but keep using dev-middleware?
The stack trace suggests an issue with the way memory-fs and lib manifest plugin interact. Memory-fs is only used by webpack-dev-middleware.
My advice would be look at the code for the lib manifest plugin to check which paths it uses from config, and then carefully check the values of those paths in the generated webpack config.