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
And run node --experimental-require-module -e 'require("./test.js")'
Describe the bug
pkg-types and mlly are circular dependencies, causing a stack overflow when the --experimental-require-module option is enabled.
Additional context
No response
Logs
❯ node --experimental-require-module -e 'require("./test.js")'
node:fs:570
functionopenSync(path, flags, mode) {
^
RangeError: Maximum call stack size exceeded
at Object.openSync (node:fs:570:18)
at readFileSync (node:fs:452:35)
at getSourceSync (node:internal/modules/esm/load:85:14)
at defaultLoadSync (node:internal/modules/esm/load:201:32)
at ModuleLoader.getModuleWrapForRequire (node:internal/modules/esm/loader:362:24)
at new ModuleJobSync (node:internal/modules/esm/module_job:276:32)
at ModuleLoader.getModuleWrapForRequire (node:internal/modules/esm/loader:403:11)
at new ModuleJobSync (node:internal/modules/esm/module_job:276:32)
at ModuleLoader.getModuleWrapForRequire (node:internal/modules/esm/loader:403:11)
at new ModuleJobSync (node:internal/modules/esm/module_job:276:32)
Node.js v20.17.0
The text was updated successfully, but these errors were encountered:
Thanks for report. I'm aware of this but both ESM and CJS loaders are supposed to support circular dependencies. In fact, the core of Node.js has many of them!
It seems an implementation issue to me with node --experimental-require-module flag..
pi0
changed the title
Circular dependency between pkg-types and mlly
node --experimental-require-module issue with dependency between pkg-types and mllyAug 24, 2024
Environment
node: v20.17.0
Reproduction
And run
node --experimental-require-module -e 'require("./test.js")'
Describe the bug
pkg-types
andmlly
are circular dependencies, causing a stack overflow when the--experimental-require-module
option is enabled.Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: