-
Notifications
You must be signed in to change notification settings - Fork 57
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
Segmentation fault in a fresh React project if using plugins #190
Comments
@swc/plugin-emotion
This is probably a regression on SWC. Can you check by using a fixed version of SWC |
I've tried upgrading to
|
I have experienced the same issue with the |
Looks like downgrading to |
|
Looks like the package for the vite swc plugin has been bumped: https://github.com/vitejs/vite-plugin-react-swc/blob/main/package.json#L17 (needs another bump already) I wonder if it would make sense to have |
Package manager allows to specify an indirect dependency (resolve or something like that). Note: While peer dep will be cleaner in theory, the idea of this plugin and the babel one is too keep them close enough so that switching from one to the other is just adding |
That's reasonable Consumers of this plugin could also choose to override the |
I encountered a similar problem related to upgrading |
@DiFuks I don't understand your use case, how does your library require to run SWC for consumers? |
I'm developing a library-bundler based on Vite, which is used for building frontends within our company. It has the following dependencies: "@swc/plugin-styled-components": "1.5.116",
"@vitejs/plugin-react-swc": "3.5.0", We use fixed versions specifically because we want to strictly control the package versions to avoid breaking changes. However, since - "@swc/plugin-styled-components": "1.5.116",
+ "@swc/plugin-styled-components": "^1.5.116",
"@vitejs/plugin-react-swc": "3.5.0", But, we still want the ability to control the version of @swc/core by passing its instance into the @vitejs/plugin-react-swc plugin. |
Yeah but in that case you will download two version of SWC. I suppose your template enforce a package manager, and in that case I think using https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides or equivalent is a better solution |
I don't see anything wrong with loading 2 versions of |
Ok I see. I personally don't advice to use Vite as a library builder. It's in freeze mode. If you still want to build in that direction you can open a feature request with a summary of the need and I can bring this up to a team meeting |
Perhaps you misunderstood me. We don't use Vite for library builds. It's used as part of our internal library for building Vite-based applications. But alright. I got you - I'll bring up a feature request. |
When I try to create a new Vite project using
yarn create vite
and selecting React with Typescript + SWC, I can performyarn build
just fine, however when Iyarn add -D @swc/plugin-emotion
and update my Vite config, the build fails with a segmentation fault.I also get the same result with
@swc/plugin-noop
and@swc/plugin-styled-components
.vite.config.ts
:package.json
Running
yarn build
gets stuck at this step:After some time, it crashes with
SIGSEGV
I'm running Arch Linux, node v20.9.0.
The text was updated successfully, but these errors were encountered: