Skip to content

[Bug]: circular import generated when using dynamic import and require #9401

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

REPL

What is expected?

No error happens when executing dist/entry-0.js.

What is actually happening?

The following error happens when executing dist/entry-0.js:

TypeError: __exportAll is not a function
    at dist/node3-DAmMu6Zs.js:3:37
    at ModuleJob.run (node:internal/modules/esm/module_job:430:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)

In other words, the cyclic import "entry-0 -> node3 -> entry-0" is not output.

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (32) x64 AMD Ryzen 9 9950X 16-Core Processor            
    Memory: 12.93 GB / 31.06 GB
  Binaries:
    Node: 24.14.1 - C:\Users\green\.vite-plus\js_runtime\node\24.14.1\node.EXE
    Yarn: 1.22.22 - C:\Users\green\.vite-plus\js_runtime\node\24.14.1\yarn.CMD
    npm: 11.11.0 - C:\Users\green\.vite-plus\js_runtime\node\24.14.1\npm.CMD
    pnpm: 10.33.4 - C:\Users\green\.vite-plus\js_runtime\node\24.14.1\pnpm.CMD
    bun: 1.3.13 - C:\Users\green\AppData\Local\Microsoft\WinGet\Links\bun.EXE
    Deno: 2.7.12 - C:\Users\green\AppData\Local\Microsoft\WinGet\Links\deno.EXE
  Browsers:
    Chrome: 148.0.7778.98
    Edge: Chromium (147.0.3912.98)
    Firefox: 150.0 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.8115
  npmPackages:
    rolldown: latest => 1.0.1

Any additional comments?

This seemed to be working with 1.0.0.
Found at sapphi-red/zarara#25 (comment)

Metadata

Metadata

Type

Priority

None yet

Effort

None yet

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions