wdjungst / react-project

State of the art web development with React.js.
1.83k stars 136 forks source link

npm test broken? "Invalid config file!" SHARED.PLUGIN undefined #40

Closed jokeyrhyme closed 8 years ago

jokeyrhyme commented 8 years ago
  1. npm install -g create-react-project (@0.0.24)
  2. create-react-project test
  3. 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

ryanflorence commented 8 years ago

probably a bug

noreiller commented 8 years ago

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 :

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.

mlesk commented 8 years ago

FYI, going back to version v0.0.20 does not suffer from this problem, it is pre webpack config refactoring.

noreiller commented 8 years ago

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

noreiller commented 8 years ago

@jokeyrhyme this issue has been fixed with @5900a49, I think you can close it now.

jokeyrhyme commented 8 years ago

Awesome! :+1: