-
-
Notifications
You must be signed in to change notification settings - Fork 90
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.