Cyclic dependency error
See original GitHub issueHi. 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:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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?
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.