When using webpack dev middleware with HMR the build is successful on the first build but when anything is changed and the build is re-evaluated an Error shows up that says something similar to:
Module build failed: Error: ENOENT: no such file or directory, open '/Users/someuser/projectroot/object-assign'
at Error (native)
Error loading /Userssomeuser/projectroot/object-assign as "object-assign" from /Users/someuser/projectroot/node_modules/babel-loader/index.js
@ ./src/client/containers/Root.js 23:14-52
I am not sure if this is a babel issue, or object-assign, but babel plugins are the only thing requiring 'object-assign' in our code base and babel-loader is reporting the error.
The issue began happening today after re-installing node modules, this was not a problem before now. Also to note that there are two different projects that were previously working that are having the same issue, both reporting same error but at different entry points.
I'm also seeing this after updating to babel 6.8.0
+1
Ye, i found a trouble package: postcss-import
Fix: npm install [email protected] --save-dev
Can confirm downgradig postcss-import makes the issue go away
Confirmed postcss-import downgrade fixes the issue. Closing this issue, anyone looking at this for same reason can follow the thread on postcss-import for more info https://github.com/postcss/postcss-import/issues/207
The current v9-dev branch of postcss-import does fix the problem.
https://github.com/postcss/postcss-import/issues/207
yarn add --dev git+https://github.com/postcss/postcss-import.git#v9-dev
Most helpful comment
Ye, i found a trouble package: postcss-import
Fix: npm install [email protected] --save-dev