npm test broken? "Invalid config file!" SHARED.PLUGIN undefined
jokeyrhyme opened this issue · comments
npm install -g create-react-project
(@0.0.24)create-react-project test
cd test; npm install
Everything seems fine up until this point.
If I then run npm test
, I get the following error:
13 03 2016 19:35:35.176:ERROR [config]: Invalid config file!
TypeError: Cannot read property 'concat' of undefined
at Object. (/.../test/node_modules/react-project/lib/webpack.shared.client.config.js:31:47)
This seems to be the line in question:
var PLUGINS = exports.PLUGINS = SHARED.PLUGINS.concat([new _webpack2.default.optimize.CommonsChunkPlugin('_vendor', 'vendor.js')]);
I haven't yet figured out where this comes from in terms of your source code. SHARED
is an Object with several keys, but there is no "PLUGINS" key.
I tried this with 0.0.23 as well, and get the same results. I've tried npm run react-project:start:prod
and I've tried setting NODE_ENV
, and nothing else seems broken, but nothing seems to get npm test
working at all.
If I'm doing something wrong, or you have more questions, please let me know. Cheers!
For context:
node --version => v5.8.0
npm --version => 3.8.1
uname -a => Linux hellmouth 4.4.5-1-ARCH #1 SMP PREEMPT Thu Mar 10 07:38:19 CET 2016 x86_64 GNU/Linux
probably a bug
Hi, I also encounter this issue. I tried with node@v4.2.1 (as in the repo) but no better result.
I tried to patch the file webpack.shared.config.js
in node_modules by adding the missing keys (PLUGINS and LOADERS) and it worked.
So, I cloned the repo to patch and make a PR but the build is not creating the following files :
- lib/webpack.client.dev.config.js
- lib/webpack.client.prod.config.js
- lib/webpack.shared.client.config.js
Can you tell me how they are created please ?
Before any PR, I prefer to be sure that it works on my project.
Thank you.
FYI, going back to version v0.0.20 does not suffer from this problem, it is pre webpack config refactoring.
Ok. I identified the bug. I will make a PR tomorrow (or monday).
Update: see PR #43
-------- Message d'origine --------
De :mlesk notifications@github.com
Envoyé :Sat, 19 Mar 2016 16:39:07 +0100
À :ryanflorence/react-project react-project@noreply.github.com
Ci :Aurélien MANCA aurelien@amanca.fr
Sujet :Re: [react-project] npm test broken? "Invalid config file!" SHARED.PLUGIN undefined (#40)
FYI, going back to version v0.0.20 does not suffer from this problem, it is pre webpack config refactoring.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
@jokeyrhyme this issue has been fixed with @5900a49, I think you can close it now.
Awesome! 👍