Comments (2)
Could that ordering be an issue that causes the runtime error?
Yes. All import statements will be hoisted.
In fact, It's a bug of tsc. see microsoft/TypeScript#16166
Could a jest plugin like this hoisting of mock calls be related?
It's possible to hoist jest related methods.
I haven't tested it myself. Have you tried manually editing the statement order of the swc compiled files?
If it is feasible, It's better to send a feature request to https://github.com/swc-project/plugins/tree/main/packages/jest , since it is related to import hoisting and this repository focuses on the mutability of export.
from swc_mut_cjs_exports.
note: it seems that esbuild-jest
is transforming the test source file using babel when the source code contains the string ock(
: aelbore/esbuild-jest@e94d4c1#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R34
from swc_mut_cjs_exports.
Related Issues (20)
- plugin crashes after update @swc/core to 1.4.0 HOT 1
- AST schema version is not compatible w/ 0.90.3 & [email protected] HOT 1
- Plugin issues on Apple M1 chipset HOT 1
- SyntaxError: Unexpected token '<' after upgrading @swc/core to 1.3.39 HOT 7
- Crashes with thread '<unnamed>' panicked at 'failed to invoke plugin HOT 12
- Dependency Dashboard
- RuntimeError: unreachable with 0.75.4 and swc/core of 1.3.57 HOT 2
- RuntimeError: unreachable with 0.76.0 and @swc/core 1.3.57 HOT 2
- Members of unnamed re-exports cannot be redefined HOT 1
- Optional chaining not transpiled properly HOT 7
- Mocha version HOT 2
- Change the plugin name to something unrelated to Jest?
- Cannot use it with yarn 3/pnp HOT 1
- Can't get tests to run to provide repro of bug
- Overriding a re-export with a local variable of same name results in runtime ReferenceError HOT 3
- Invalid left-hand side in assignmet when using swc_mut_cjs_exports HOT 1
- TypeError when accessing exported member with "circular" dependency on barrel file HOT 7
- Failed to invoke plugin HOT 4
- Not compatible with @swc/core v1.0.6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swc_mut_cjs_exports.