-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundling has infinite loop with certain circular dependency scenarios #8224
Bundling has infinite loop with certain circular dependency scenarios #8224
Comments
Try on Deno v1.5.1 |
This is what I used:
|
Hm, try clear the cache:
|
@ebebbington that is unlikely to work as @rracariu any chance you could do |
The debug part that keeps repeating itself looks like:
The code base is quite large but the module ids are related to a certain package we are using. |
Here is the result of
|
Any chance that you could point out at least |
Debug log is not about looping. Edit: I fixed the stack overflow |
swc_bundler: - Fix infinte loop (denoland/deno#8224) - Fix order of merging with circular imports. (Fixes denoland/deno#8246) - Fix detection of circular imports. - Fix logic of lca calculation. - Fix sorting algorithm.
This bug is still present in Deno 1.6.0
|
It is a regression. We need to add a test for this. cc/ @kdy1 |
See: denoland/deno#8224 Not entirely sure how to resolve this beyond pulling JSDOM out of the bundled dependencies for now.
@rracariu can you try again with deno |
Still reproduces in |
Tried this on
Observation is that the process doesn't take a lot of CPU but it increasingly consuming more memory, I stopped once it reached 1.4 GB. |
Can you provide more info? |
Here is the sudo perf report --call-graph
|
Thanks! |
It's not a bad idea... it would certainly help people file/track issues directly with swc. The encapsulation counter-argument is just as applicable to V8 and TS. The real problem is that swc is a lot of crates with a lot of versions and I don't think the overarching structure is stable. |
How deep does the rabbit hole go then? List all the dependencies in the Cargo.toml? For users reporting the issue, the Deno version is sufficient to identify all the Rust dependencies used. Both TypeScript and V8 are useful, because in both cases there are user definable configuration which can impact how they work, which isn't the case for swc (at least not in any meaningful way) |
I don't know. But looks to me that SWC is a major component of Deno. Maybe this would be the criteria for adding info about dependencies? |
Can you try again? |
Perf data
The debug output
|
Still encountering this issue, see https://gist.github.com/ebebbington/4c43ef492200677cc0a27339f5ea51dd this is a really odd case though |
can confirm this is a case of circular dependency though |
Can you share the import tree? (Only import/export statements are required) I expect this bug to be related to of detection of import cycle, but it's too hard to reproduce. |
It's a massive tree.. though we've narrowed it down: https://github.com/0kku/destiny/blob/master/src/parsing/_xml.ts uses https://github.com/0kku/destiny/blob/master/src/parsing/createTemplate.ts, which needs https://github.com/0kku/destiny/blob/master/src/componentLogic/DestinyFallback.ts, which needs that |
|
Can you try it again after updating |
@kdy1 How do I update the |
@kdy1 it did fix my issue, thanks |
At this moment in time, Deno is v1.11.5. For anyone encountering this problem, update to canary. Should there be new release(s) out by the time you read this, check the release notes for a release that bumped |
I confirm that on canary build the issue doesn't manifest itself, and the bundler produces a JavaScript file. |
In |
New bundler gets into an infinite loop and never completes the bundle.
This used to work on versions <1.5. Unfortunately can't share the code and I don't know how to minimize the testcase...
The text was updated successfully, but these errors were encountered: