You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The behaviour in Node is correct, although admittedly it is a bit confusing, I think what you're expecting is that because two modules have the same identifier the same module should be returned, but actually the identifier is just a thing for tracebacks, you can have many modules with the same identifier.
If you want it to actually link in a cycle you need to return the same module object, i.e. you'll need to cache and return the same object.
Version
v16.9.0
Platform
Darwin MrBBots-MBP 19.6.0 Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64 x86_64
Subsystem
vm
What steps will reproduce the bug?
With the import graph
A -> B <-> C
,vm.SourceTextModule#link
ends up in a cycle.See reproduction here: https://github.com/mrbbot/cycles-issue.
How often does it reproduce? Is there a required condition?
No required condition, happening all the time.
What is the expected behavior?
The
link
callback is called once per module.What do you see instead?
The
link
callback is called infinitely many times, in a cycle between modulesB
andC
.Additional information
Discovered when trying to run the example from https://blog.cloudflare.com/workers-rust-sdk/ with Miniflare.
/cc @jasnell
The text was updated successfully, but these errors were encountered: