Open bvobart opened 1 year ago
@JesseVelden and @YassinEldeeb, from the commit history it seems that you are the authors of @graphql-codegen/client-preset-swc-plugin
, do you happen to know more about what is causing this issue?
Hi @YassinEldeeb and @victorandree, thank you both for #9489 and your patched @victorandree/graphql-codegen-client-preset-swc-plugin NPM package!
This has fixed the original syntax error that I was getting. However, the issue isn't entirely fixed yet. As soon as I import code from another TypeScript file, I get a different syntax error, even though I've updated my example repo to use the patched SWC plugin and I've updated all dependencies to versions that should be compatible (in particular @swc/core
is now 1.3.80
to be compatible with swc_core 0.79.x
.
Could you look into this again please? :blush:
Which packages are impacted by your issue?
Describe the bug
When I enable
@graphql-codegen/client-preset-swc-plugin
in my NodeJS project, Jest fails to run any tests I create for it due to aSyntaxError: Malformed arrow function parameter list
. Disabling the plugin (simply removing.swcrc
or removingjsc.experimental.plugins
from the.swcrc
) or removing thetransform
property from Jest, makes the test run as expected.Your Example Website or App
https://github.com/bvobart/gql-client-preset-swc-jest-issue
Steps to Reproduce the Bug or Issue
git clone git@github.com:bvobart/gql-client-preset-swc-jest-issue.git
cd gql-client-preset-swc-jest-issue
yarn
yarn jest issue.test.ts
The ReadMe of the MRE repo also contain these instructions.
Expected behavior
I'm expecting the test to fail because
1+1
is2
not3
like the test asserts, but instead, Jest fails to run the test due to a SyntaxError:When I remove the
transform
property from the Jest config, then the test runs as expected (but only because this test contains no TypeScript-specific syntax and is otherwise compatible with Node v16). Alternatively, when I remove theclient-preset-swc-plugin
from the.swcrc
, then the test also runs as expected.P.S. sorry for not forking your MRE repo, I already made my own before making this issue. Still really easy to reproduce though :man_shrugging:
Screenshots or Videos
No response
Platform
graphql
version: 16.6.0 (latest at the time of writing)@graphql-codegen/*
version(s): Latest at the time of writing.Codegen Config File
Additional context
jest.config.js
: