question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cyclic dependency after upgrade to latest next version (2.0.0-next.3e165448)

See original GitHub issue

Is 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:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
packetstracercommented, Jun 26, 2018

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

plugins: [

    new InterpolateHtmlPlugin(env.raw),

    // Generates an index.html file with the <script> injected.

    new HtmlWebpackPlugin({

      inject: true,

      template: paths.appHtml,

      chunksSortMode: 'none'

    }),

    ...

    ]
1reaction
Timercommented, Jun 23, 2018

Please provide a reproducible demo or there’s no way we can fix this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I am getting cyclic dependency issue when I upgrade to ...
This error occurred because of that you instantiated the MessagingService inside of MessageService too. This way you created a cycle of ...
Read more >
Xcode 13.3 cycle in dependencies between targets
So using latest Xcode 13.3 on an Apple Silicon MacBook I get a compile error the 2nd time and every time there after...
Read more >
SpringBoot 2.6.x coping strategies after disabling cyclic ...
If you upgrade from a low version to 2.6.x, then the first problem you are likely to encounter is a circular dependency problem....
Read more >
NG0200: Circular dependency in DI detected while ... - Angular
A cyclic dependency exists when a dependency of a service directly or indirectly depends on the service itself. For example, if UserService depends...
Read more >
How to fix nasty circular dependency issues once and for all in ...
Next, there are two specializations, Node , and Leaf . This works fine and dandy, but maintaining three classes in a single file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found