`mut-cjs-exports` doesn't properly handle circular imports with barrel files
@kdy1 is already working on this.
Since Mar 21, 2026.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
When a dependency cycle includes a barrel file, imports are not resolved properly.
See this issue on the original repo for a more detailed explanation of the issue.
URL to minimal reproduction
Please provide a minimal reproduction of the issue. Ideally, the reproduction should only have
@swc/coreornext- the problematic Wasm plugin
as the dependency.
https://github.com/karmeleon/swc-jest-repro/tree/main
Expected behavior
The tests in the above repo should pass -- see README for details.
Additional context
The recommendation on the original repo was to override Object.defineProperty to make all invocations of it configurable. However, since swc without this plugin transpiles CJS exports to use getters and does not include setters, simply setting configurable throws the error TypeError: Cannot set property notify of [object Object] which has only a getter. I haven't been able to write a new defineProperty shim that works reliably.
- Dominant language
- Rust
- Stars
- 389
- Forks
- 106
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
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 swc-project/plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swc-project/plugins#655 ·
-
swc-project/plugins#656 · 1 comment · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
swc-project/plugins#612 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
swc-project/plugins#610 · 1 reaction ·
-
enhancement
swc-project/plugins#574 · 8 comments · 1 assignee ·
All issues in swc-project/plugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100