Cyclic dependency after upgrade to latest next version (2.0.0-next.3e165448)
See original GitHub issueIs this a bug report?
yes
Did you try recovering your dependencies?
yes
Which terms did you search for in User Guide?
npm run start
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules/foundation-sites/scss/ src/ -o src/ --watch --recursive",
"start": "npm-run-all -p watch-css start-js",
"start-js": "NODE_PATH=src BROWSER=none react-scripts start",
"build-js": "NODE_PATH=src node build.js",
"test": "NODE_PATH=src react-scripts test --env=jsdom"
},
Environment
/Frontend/node_modules/toposort/index.js:35 throw new Error(‘Cyclic dependency’ + nodeRep) ^
Error: Cyclic dependency at visit (/Frontend/node_modules/toposort/index.js:35:13) at visit (/Frontend/node_modules/toposort/index.js:53:9) at visit (/Frontend/node_modules/toposort/index.js:53:9) at Function.toposort [as array] (/Frontend/node_modules/toposort/index.js:22:22) at Object.module.exports.dependency (/Frontend/node_modules/html-webpack-plugin/lib/chunksorter.js:50:35) at HtmlWebpackPlugin.sortChunks (/Frontend/node_modules/html-webpack-plugin/index.js:364:35) at /Frontend/node_modules/html-webpack-plugin/index.js:113:21 at AsyncSeriesHook.eval [as callAsync] (eval at create (/Frontend/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1) at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Frontend/node_modules/tapable/lib/Hook.js:35:21) at Compiler.emitAssets (/Frontend/node_modules/webpack/lib/Compiler.js:307:19)
Steps to Reproduce
(Write your steps here:)
I used “2.0.0-next.66cc7a90” before and everything works fine. I just changed the version to “2.0.0-next.3e165448” and i got the Cyclic dependency problem
Expected Behavior
a development server should deliver my react project
Actual Behavior
crash
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:10 (1 by maintainers)
Top GitHub Comments
Same here. Tried to install dependencies with yarn and npm, neither of both works.
I’ve found a workaround in the meantime that seems to work. Extracted from here:
https://github.com/jantimon/html-webpack-plugin/issues/870
In case it helps, it seems a HtmlWebpackPlugin bug, though it’s been resolved in the issue linked above for some reason it’s not working, I guess it hasn’t been merged already or CRA is not using the right dep for the plugin
html-webpack-plugin@next
Hope this helps solve the issue.
For the case anyone is willing to apply the workaround, just add the property
chunksSortMode: 'none'
in HtmlWebpackPlugin initialization in /Users/ivanmerinrodriguez/Sites/cap/cbk-sparq/global/node_modules/react-scripts/config/webpack.config.dev.js file, just like this
Please provide a reproducible demo or there’s no way we can fix this.