-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Description
Expected Behavior
When running an application that has circular deps with import-in-the-middle, it should handle this accordingly.
Actual Behavior
It silently fails in pre Node 20, and in Node 20 errors with
file:///Users/revans/code/cyclic-loader-issue/dep-2.js:5
dep1()
^
ReferenceError: Cannot access 'dep1' before initialization
at dep2 (file:///Users/revans/code/cyclic-loader-issue/dep-2.js:5:3)
at file:///Users/revans/code/cyclic-loader-issue/dep-1.js:7:1
at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:308:24)
at async loadESM (node:internal/process/esm_loader:42:7)
at async handleMainPromise (node:internal/modules/run_main:66:12)Steps to Reproduce the Problem
git clone https://github.com/bizob2828/cyclic-loader-issuenpm i && npm run start
Specifications
- Version: Node 16,18,20.
- Platform: All
- Subsystem: All
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels