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.

BuildCycleError with a module blocking itself

See original GitHub issue

DISCLAIMER: I don’t have a minimal reproduction example, I only have this issue in a big project which I can’t share. I understand that the issue might be closed because of this, but maybe you’ll help me to understand if it’s even a bug of webpack

Bug report

What is the current behavior?

I have a big project that uses https://github.com/4Catalyzer/astroturf for styling. I have several places where I have a ton of styles interpolating each other but this is working fine with webpack@4.

Now I am trying to upgrade to webpack@5 and I’m getting an error saying There is a circular build dependency, which makes it impossible to create this module

If the current behavior is a bug, please provide the steps to reproduce.

Unfortunately, I am unable to create a minimal example, see the disclaimer above.

What is the expected behavior?

There should not be any unsolvable cyclic dependencies because webpack 4 is able to build the same app

I’ve tried to solve it myself which lead me to here https://github.com/webpack/webpack/blob/b7f382878e50452d02c7ad1eeaf28f14d40b29ce/lib/Compilation.js#L1814-L1831

After some debugging I found out that the blockReasons of the module that causes the cycle is that same module (and it is the only item in the blockReasons), so looks like it “imports itself”. This might be an issue in astroturf (so I’m tagging @jquense as its author) but my question to webpack team is the following:

Is it an intended thing that a module can potentially end up blocking itself? I’ve tried adding a line if (item === module) continue after line 1821 and this resolved all my issues so there’s no real deadlock - the build completes

Other relevant information: webpack version: 5.55.1 Node.js version: v14.17.0 Operating System: MacOS Additional tools: astroturf version 1.0.0-beta22 (latest)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
h4lcommented, Oct 18, 2021

I also encountered BuildCycleError being incorrectly reported when porting a Webpack 4.x build to 5.x. I looked into it and found an error in the cycle tracking code which is fixed in the linked PR.

1reaction
alexander-akaitcommented, Oct 1, 2021

Will be great to report it to astroturf , we don’t have special magic for loadModule

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spid is blocking itself? – SQLServerCentral Forums
There's no deadlock or anything. Just sp_who2 shows the process is blocking itself. Got any explanations I'd be appreciative. Gail Shaw.
Read more >
proc blocking itself - MSDN - Microsoft
Hi experts,. This process 96, is blocking itself… The user that ran it, said it usually takes 10 minutes to run, and now...
Read more >
Is it allowed to instantiate a module inside always_comb block ...
So to execute any module, just instantiate it, providing the required inputs to it (and add the always block in the sub-module itself, ......
Read more >
SSIS Blocking itself with IsolationLevel read Uncommited and ...
to check how many transactions you have open select @@opentran. if all you want to do is not to be affected by blocking...
Read more >
Verilog Blocking & Non-Blocking - ChipVerify
Blocking Blocking assignment statements are assigned using = and are ... of statments that run in a parallel block. module tb; reg [7:0]...
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