generator-redux icon indicating copy to clipboard operation
generator-redux copied to clipboard

Scaffold broken as soon as it is run

Open digijin opened this issue 9 years ago • 11 comments

Tried on 5.0.0, 4.2.1, 4.0.0, 0.12.7 and all got the same error.

Installs fine, when I run npm start I get the following error that appears to come out of webpack:

> [email protected] start /home/james/workspace/network/awsconsole
> DEBUG=true node server.js

Listening at localhost:3000
webpack built 760b78bcfc171041ac0c in 778ms
Hash: 760b78bcfc171041ac0c
Version: webpack 1.12.9
Time: 778ms
    Asset     Size  Chunks       Chunk Names
bundle.js  58.9 kB       0       main
chunk    {0} bundle.js (main) 12.4 kB [rendered]
    [0] multi main 40 bytes {0} [built] [1 error]
    [1] ./~/querystring/decode.js 2.4 kB {0} [built]
    [2] ./~/querystring/encode.js 2.09 kB {0} [built]
    [3] ./~/querystring/index.js 127 bytes {0} [built]
    [4] (webpack)-hot-middleware/client-overlay.js 1.01 kB {0} [built]
    [5] (webpack)-hot-middleware/client.js?path=/__webpack_hmr&timeout=20000 3.24 kB {0} [built]
    [6] (webpack)-hot-middleware/~/ansi-regex/index.js 145 bytes {0} [built]
    [7] (webpack)-hot-middleware/~/strip-ansi/index.js 161 bytes {0} [built]
    [8] (webpack)-hot-middleware/process-update.js 2.95 kB {0} [built]
    [9] (webpack)/buildin/module.js 251 bytes {0} [built]

ERROR in ./js/index.js
Module build failed: ReferenceError: The plugin "react.displayName" collides with another of the same name
    at PluginManager.validate (/home/james/workspace/network/awsconsole/node_modules/babel-core/lib/transformation/file/plugin-manager.js:159:13)
    at PluginManager.add (/home/james/workspace/network/awsconsole/node_modules/babel-core/lib/transformation/file/plugin-manager.js:213:10)
    at File.buildTransformers (/home/james/workspace/network/awsconsole/node_modules/babel-core/lib/transformation/file/index.js:237:21)
    at new File (/home/james/workspace/network/awsconsole/node_modules/babel-core/lib/transformation/file/index.js:139:10)
    at Pipeline.transform (/home/james/workspace/network/awsconsole/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at transpile (/home/james/workspace/network/awsconsole/node_modules/babel-loader/index.js:12:22)
    at Object.module.exports (/home/james/workspace/network/awsconsole/node_modules/babel-loader/index.js:71:12)
 @ multi main

digijin avatar Dec 17 '15 07:12 digijin

+1

Utsav2 avatar Dec 22 '15 04:12 Utsav2

Yup, I got the same.

callummr avatar Dec 22 '15 07:12 callummr

@digijin @Utsav2 @callummr I am not able to reproduce, but wonder if there is a collision between any .babelrc files?

Here is where the react-display-name plugin is added in a .babelrc file included in the project: https://github.com/banderson/generator-redux/blob/master/generators/app/templates/_babelrc

Do you have a .babelrc in your home directory that may be conflicting?

kevinold avatar Dec 22 '15 15:12 kevinold

Oh, and on second read of the error message, this might be a babel issue in that the plugins of the same name are "colliding". I'll investigate.

kevinold avatar Dec 22 '15 15:12 kevinold

This appears to be happening elsewhere:

https://github.com/sapegin/react-styleguidist/issues/58

kevinold avatar Dec 22 '15 16:12 kevinold

Has this fix been released? Because I've just done clean install of the generator and am still exeriencing this exact issue.

Looking at the .babelrc in master and the one placed in the project by the generator differ by what seems to be the issue. I'm going to copy the .babelrc in master into my project and give it a go.

martinffx avatar Jan 19 '16 04:01 martinffx

Same here!

alfafc avatar Jan 21 '16 20:01 alfafc

If anyone finds a fix or work around please post it here thanks.

todthomson avatar Jan 22 '16 01:01 todthomson

@martinffx you are correct, it has not been released yet.

The fix is simple, apply the .babelrc change as you said and then ensure you have babel-plugin-react-transform@^1.0.0 - the 2.x branch is meant for Babel 6.x, which this generator has not been updated to use yet (though there is a good PR out there for it).

kaylanm avatar Jan 22 '16 05:01 kaylanm

@kaylanm thanks, I managed to manually edit the generated code into a working state. Would be nice to fix this generator though. What needs to happen to get this PR merged?

martinffx avatar Jan 26 '16 22:01 martinffx

Hey everyone, I missed this yesterday because it was marked as closed. I released a new version yesterday that includes the babel6 upgrades and a few bug fixes. I hope that this is all set now, so please let me know if you see anything like this after using v0.4.1

banderson avatar Jan 27 '16 22:01 banderson