[Bug Report]: Cannot access '{default export}' before initialization
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- next.js, node.js, typescript
- Domain
- build-system, frontend
Research direction
Read the reported import chain from LogicFlow.js through model/index.js, LineEdgeModel.js, BaseEdgeModel.js, and util/edge.js; reproduce the error with LogicFlow 2.2.5 in Next.js 16.4.0 using Turbopack. Trace the circular ESM imports that trigger the temporal dead zone and check whether the same entry point works under CommonJS. Done means imports from logicflow/core no longer raise the reported initialization error.
Written by the indexing model from the issue text.
Description
发生了什么?
logicflow/core 2.2.0 和 2.2.5 中可能存在 TDZ 问题。
在 Next.js 16.4.0 (Turbopack) 中,任何来自 logicflow/core 的导入都会报错:
Runtime ReferenceError: Cannot access '{default export}' before initialization
导致 TDZ 的循环链可能在:
LogicFlow.js
→ model/index.js
→ model/edge/index.js
→ LineEdgeModel.js
→ BaseEdgeModel.js
→ util/index.js
→ util/edge.js
→ model/index.js
其中 model/index.js 依赖 LineEdgeModel.js,但是 LineEdgeModel.js 又依赖 model/index.js,形成 TDZ,不过这是 ESM 里特有的问题,在 CJS 中不存在。
logicflow/core版本
2.2.5
logicflow/extension版本
null
logicflow/engine版本
null
浏览器&环境
Chrome, NodeJS
- Dominant language
- TypeScript
- Stars
- 11.8k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from didi/LogicFlow
-
[Bug Report]: getBytesLength counts every character as uppercase when a word has one capital, and snapToGrid never snaps to 0Possibly taken @qq2514568380 claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Bug Report]: resize改变画布尺寸未完全生效Possibly taken @dvd233 claimed this 70 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
[Bug Report]: 框选引用冲突Uncaught TypeError: dynamicGroup_1.getGroupByNodeId is not a functionMay be free again @Wang-Yi-Teng claimed this 117 days ago, and no pull request is open. Open
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
bug done
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
neavo/LinguaGacha#1124 ·
Maintainers usually reply within 1 day
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errorsPossibly taken @fullsend-ai-coder claimed this today. Opene2e-failure ready-to-code
Difficulty 2/5 Under an hour Newbie friendliness 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
brylie/mission-island#225 ·
Maintainers usually reply within 1 day
-
enhancement from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nightly-labs/openbot#14986 ·
Maintainers usually reply within 1 day
-
status/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google-gemini/gemini-cli#30412 · 1 comment ·
Maintainers usually reply within 1 day