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 error

See original GitHub issue

Hi. Thanks for the fork of mocha-webpack. I’m trying to move my project from webpack 3 to 4 and all works fine except tests. I get this error:

 WEBPACK  Compiled successfully in 66060ms

Error: Cyclic dependency
    at visit (C:\pr\frontend\node_modules\toposort\index.js:35:13)
    at visit (C:\pr\frontend\node_modules\toposort\index.js:53:9)
    at visit (C:\pr\frontend\node_modules\toposort\index.js:53:9)
    at Function.toposort [as array] (C:\pr\frontend\node_modules\toposort\index.js:22:22)
    at sortChunks (C:\pr\frontend\node_modules\mochapack\lib\webpack\util\sortChunks.js:35:41)
    at getBuildStats (C:\pr\frontend\node_modules\mochapack\lib\webpack\util\getBuildStats.js:29:47)
    at TestRunner.prepareMocha (C:\pr\frontend\node_modules\mochapack\lib\runner\TestRunner.js:139:52)
    at C:\pr\frontend\node_modules\mochapack\lib\runner\TestRunner.js:192:38
    at C:\pr\frontend\node_modules\mochapack\lib\webpack\compiler\registerReadyCallback.js:26:7
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\pr\frontend\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:27:1)
    at AsyncSeriesHook.lazyCompileHook (C:\pr\frontend\node_modules\tapable\lib\Hook.js:154:20)
    at emitRecords.err (C:\pr\frontend\node_modules\webpack\lib\Compiler.js:267:22)
    at Compiler.emitRecords (C:\pr\frontend\node_modules\webpack\lib\Compiler.js:449:39)
    at emitAssets.err (C:\pr\frontend\node_modules\webpack\lib\Compiler.js:261:10)
    at hooks.afterEmit.callAsync.err (C:\pr\frontend\node_modules\webpack\lib\Compiler.js:435:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\pr\frontend\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at AsyncSeriesHook.lazyCompileHook (C:\pr\frontend\node_modules\tapable\lib\Hook.js:154:20)
    at asyncLib.forEachLimit.err (C:\pr\frontend\node_modules\webpack\lib\Compiler.js:432:27)
    at C:\pr\frontend\node_modules\neo-async\async.js:2818:7
    at done (C:\pr\frontend\node_modules\neo-async\async.js:3522:9)
    at MemoryFileSystem.writeFile (C:\pr\frontend\node_modules\memory-fs\lib\MemoryFileSystem.js:328:9)
    at writeOut (C:\pr\frontend\node_modules\webpack\lib\Compiler.js:415:30)
    at Immediate.<anonymous> (C:\pr\frontend\node_modules\memory-fs\lib\MemoryFileSystem.js:288:4)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I found similar issue in html-webpack-plugin https://github.com/jantimon/html-webpack-plugin/issues/981

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
FullStackAlexcommented, Jul 30, 2019

Hmm, great. So actually no difference to the unmaintained mocha-webpack 😂

This error is caused by toposort. But as mochapack is using it, this becomes automatically an issue of mochapack. Isn’t it logical?

0reactions
larixercommented, Aug 2, 2019

Hopefully should be fixed via: https://github.com/sysgears/mochapack/commit/1944c97e99ae9752ddf21bc9fcc58c32148a4cd1 and published as mochapack@1.1.3

Hopefully, because the issue doesn’t reproduce for me and I have no reproduction steps.

Feel free to reopen this ticket, but this time with reproduction steps please.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a circular dependency and how can I solve it?
A circular dependency is where Project A depends on something in Project B and project B depends on something in Project A. This...
Read more >
How to fix the “Circular dependency detected” error in Google ...
When you see the circular dependency detected error displayed in your Google spreadsheet, this means that your formula is referring to a range...
Read more >
NG0200: Circular dependency in DI detected while ... - Angular
Break this loop (or circle) of dependency to resolve this error. This most commonly means removing or refactoring the dependencies to not be...
Read more >
Circular Dependencies in Spring - Baeldung
When we have a circular dependency, it's likely we have a design problem and that the responsibilities are not well separated.
Read more >
How to fix nasty circular dependency issues once and for all in ...
Yet it is not very easy to follow in large projects. The reason for this, is that as soon as you have a...
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