-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SWC Compatibility #2806
Comments
Can you post your Are decorators enabled in the |
Here's the swc config from the vite-plugin-node library, which works for me:
|
|
Are you using Vite with NestJS? If so, is it a lot better? Do you think it will help make SWC work? |
I am using Vite with NestJS, through vite-plugin-node. There are a number of issues (mainly, no support for WebSockets), but it does work... |
Ah, that might be a dealbreaker. We are using GraphQL Subscriptions. |
See this comment for the solution I am currently using. It is working well. |
CLI plugins don't work with SWC, as stated in the docs. |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
SWC works for NestJS but not NestJS/GraphQL.
It gives errors because SWC doesn't handle decorators such as @InputObject() and @typeobject().
Errors look like this:
The problem is that _GRAPHQL_METADATA_FACTORY() is not in the compiled JS.
You could reproduce this by running the standard
next build
script that usestsc
and looking at an input type that uses @InputObject(). Then running the swc build script (something like:npx swc src -d dist/src
) and comparing the results. You will notice the_GRAPHQL_METADATA_FACTORY()
is missing since it is created with the decorator.Describe the solution you'd like
Ultimately, I just want it to work even if its a work around.
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
SWC is WAY faster than TSC, like 20x faster.
The text was updated successfully, but these errors were encountered: