Webpack issue with npm run build
ericln opened this issue · 4 comments
I have been seeing the following error recently once I clear the node_module
and rebuild. I have just downloaded the megaboilerplate zip file again with the following configuration, and still having the same issue. Tried it with other build system ( gulp and npm) they seems to be ok.
- Platform: node
- Framework: express
- Template Engine: handlebars
- CSS Framework: none
- CSS Preprocessor: sass
- JavaScript Framework: react
- Build Tool: webpack
- Unit Testing: mocha
- Database: none
- Authentication:
- Deployment: none
ERROR in ./app/components/App.js
Module build failed: TypeError: /Users/ericlin/projects/temp/360/app/components/App.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "CallExpression"
at Object.validate (/Users/ericlin/projects/temp/360/node_modules/babel-types/lib/definitions/index.js:109:13)
at Object.validate (/Users/ericlin/projects/temp/360/node_modules/babel-types/lib/index.js:541:9)
at NodePath._replaceWith (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/path/replacement.js:208:7)
at NodePath.replaceWith (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/path/replacement.js:186:8)
at RewireState.Identifier (/Users/ericlin/projects/temp/360/node_modules/babel-plugin-rewire/lib/babel-plugin-rewire.js:176:10)
at NodePath._call (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/path/context.js:76:18)
at NodePath.call (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/path/context.js:48:17)
at NodePath.visit (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/path/context.js:106:12)
at TraversalContext.visitQueue (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/context.js:167:16)
at TraversalContext.visitSingle (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/context.js:118:19)
at TraversalContext.visit (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/context.js:211:19)
at Function.traverse.node (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/index.js:161:17)
at NodePath.visit (/Users/ericlin/projects/temp/360/node_modules/babel-traverse/lib/path/context.js:116:19)
I am also having this issue with the following versions:
node: v6.3.1
npm: v3.10.3
webpack: v1.13.1
Looks like a babel issue. I will try to investigate it further.
@ericln Remove this code from .babelrc
:
"env": {
"development": {
"plugins": ["rewire"]
}
}
Something has changed between babel-plugin-rewire 1.0.0-rc-3
and 1.0.0-rc-5
which is causing the build to break. I don't have time to investigate every commit in that project, but I can remove ^
from the generator code so that it uses specifically version 1.0.0-rc-3
as an interim solution.