You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EDIT: I don't think react runtime is supported by @swc-node at all.@swc-node/loader works in webpack but the bundle produced does not have the react runtime.
Below is the original issue:
my project was using @swc/jest and a .swcrc like this and jest works fine:
I changed jest config from "^.+\\.(t|j)sx?$": "@swc/jest", to "^.+\\.(t|j)sx?$": "@swc-node/jest", and got error ReferenceError: React is not defined. I copied the configs in .swcrc from above into jest config and still got the same error. It seems the react runtime configuration is not applied by @swc-node/jest but am applied by @swc/jest?
The text was updated successfully, but these errors were encountered:
zfwf
changed the title
@swc-node/jest does not handle react-jsx runtime
@swc-node/jest ReferenceError: React is not defined
Dec 16, 2021
EDIT: I don't think react runtime is supported by
@swc-node
at all.@swc-node/loader
works in webpack but the bundle produced does not have the react runtime.Below is the original issue:
my project was using
@swc/jest
and a.swcrc
like this and jest works fine:I want to move to
@swc-node/jest
since I already have atsconfig.json
and I don't see a need to maintain both the.swcrc
andtsconfig.json
.I changed jest config from
"^.+\\.(t|j)sx?$": "@swc/jest",
to"^.+\\.(t|j)sx?$": "@swc-node/jest",
and got errorReferenceError: React is not defined
. I copied the configs in.swcrc
from above into jest config and still got the same error. It seems the react runtime configuration is not applied by@swc-node/jest
but am applied by@swc/jest
?The text was updated successfully, but these errors were encountered: