structor
structor copied to clipboard
webpack version conflict when following "Integration with Create React App" doc
When following the steps here https://github.com/ipselon/structor/blob/master/docs/integrating-with-create-react-app.md I ran into a webpack issue that appears to stem from a version conflict between the version of structor (2.3.2) and react-scripts (1.0.14) npm pulled by default.
To reproduce the issue just follow the steps in the doc e.g.
sudo npm install -g create-react-app
create-react-app structor-test
cd structor-test/
npm install structor
npm install -D cross-env
vim package.json
npm run structor
Then when you navigate to localhost:2222/structor nothing shows up in the workspace. I got this error in the server console, not sure if it's related or not
TypeError: m.forEachChunk is not a function
at modules.forEach.m (/home/jtbeckha/workspace/learning/structor-test/node_modules/webpack/lib/optimize/OccurrenceOrderPlugin.js:26:8)
at Array.forEach (<anonymous>)
at Compilation.compilation.plugin (/home/jtbeckha/workspace/learning/structor-test/node_modules/webpack/lib/optimize/OccurrenceOrderPlugin.js:23:13)
at Compilation.applyPlugins1 (/home/jtbeckha/workspace/learning/structor-test/node_modules/tapable/lib/Tapable.js:75:14)
at sealPart2 (/home/jtbeckha/workspace/learning/structor-test/node_modules/structor/node_modules/webpack/lib/Compilation.js:589:9)
at Compilation.applyPluginsAsyncSeries (/home/jtbeckha/workspace/learning/structor-test/node_modules/tapable/lib/Tapable.js:195:46)
at Compilation.seal (/home/jtbeckha/workspace/learning/structor-test/node_modules/structor/node_modules/webpack/lib/Compilation.js:579:8)
at /home/jtbeckha/workspace/learning/structor-test/node_modules/structor/node_modules/webpack/lib/Compiler.js:493:16
at /home/jtbeckha/workspace/learning/structor-test/node_modules/tapable/lib/Tapable.js:289:11
at _addModuleChain (/home/jtbeckha/workspace/learning/structor-test/node_modules/structor/node_modules/webpack/lib/Compilation.js:481:11)
After some investigation I discovered react-scripts is using [email protected], and structor is using [email protected]. I was able to fix my project by rolling back to react-scripts 1.0.10 which is still on webpack 2, but wanted to create this issue to find out if there is a better way to fix it (I'm still relatively new to the react/js ecosystem), and say it might be worth adding a note to that doc about this
I have this question too.
I also had the same problem - my specific steps to get it working were -
- followed all instructions down to and including "cd my-notes"
- did "npm list react-scripts" to check version - found it was > 1.0.10 (see jtbeckha's text above) so
- did "npm uninstall react-scripts" followed by
- npm install [email protected]
then continued working through the original instructions from "npm install structor".
I also resolved with "react-scripts": "1.0.10" into package.json
@ipselon maybe can be useful changing documentation