Skip to content

[Bug Report]: Cannot access '{default export}' before initialization #2426

Open

Description

@qingqiuyao

发生了什么?

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions