Skip to content
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

Update major version of swc_core for plugins at same time as @swc/core #359

Closed
rakleed opened this issue Nov 2, 2024 · 4 comments
Closed

Comments

@rakleed
Copy link

rakleed commented Nov 2, 2024

Please update the major version of swc_core for plugins simultaneously with @swc/core. I have now installed @swc/plugin-styled-components v4.0.0, but since it also expects swc_core version 4, it does not work with the current @swc/core v1.7.42, because it still has version 3 of core.

Error:
1: failed to run Wasm plugin transform. Please ensure the version of swc_coreused by the plugin is compatible with the host runtime. See the documentation for compatibility information. If you are an author of the plugin, please updateswc_core to the compatible version.

@kdy1
Copy link
Member

kdy1 commented Nov 3, 2024

No it’s not possible.
Use plugins.swc.rs

@kdy1 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2024
@kdy1
Copy link
Member

kdy1 commented Nov 3, 2024

Wasm plugins are experimental

@rakleed
Copy link
Author

rakleed commented Nov 4, 2024

@kdy1 I still get this error with @swc/plugin-styled-components@4.0.0 when upgrading to @swc/core@1.8.0 with swc_core@4.0.3. Here's the full log:

Log:
[plugin:vite:react-swc] failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("my-project/src/index.jsx")'

Caused by:
    0: failed to invoke `my-project/node_modules/@swc/plugin-styled-components/swc_plugin_styled_components.wasm` as js transform plugin at my-project/node_modules/@swc/plugin-styled-components/swc_plugin_styled_components.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See the documentation for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
                        
                       Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.
                        
                       https://swc.rs/docs/plugin/selecting-swc-core
       
                       See https://plugins.swc.rs/versions/from-plugin-runner/3.0.0 for the list of the compatible versions.
                        
                       Build info: 
                           Date: 2024-11-04
                           Timestamp: 2024-11-04T01:54:05.821856000Z
                           
                       Version info: 
                           swc_plugin_runner: 3.0.0
                           Dependencies: anyhow 1.0.92,codspeed-criterion-compat 2.7.2,criterion 0.5.1,enumset 1.1.5,futures 0.3.31,once_cell 1.20.2,parking_lot 0.12.3,serde 1.0.214,serde_json 1.0.132,swc_atoms 2.0.0,swc_common 3.0.0,swc_css_ast 3.0.0,swc_css_parser 3.0.0,swc_ecma_ast 3.0.0,swc_ecma_loader 3.0.0,swc_ecma_parser 4.0.0,swc_ecma_visit 3.0.0,swc_malloc 1.0.0,swc_plugin_proxy 3.0.0,testing 3.0.0,tokio 1.41.0,tracing 0.1.40,vergen 9.0.1,virtual-fs 0.16.0,wasmer 4.3.7,wasmer-cache 4.3.7,wasmer-compiler-cranelift 4.3.7,wasmer-wasix 0.27.0
                       
    2: RuntimeError: unreachable

Although on https://plugins.swc.rs/versions/range/19 they are listed as compatible.

By the way, the link https://plugins.swc.rs/versions/from-plugin-runner/3.0.0 from the error message shows no information.

And initially I asked to simply release @swc/core simultaneously with the update of the swc_core dependency in plugins, since previously I always updated to the latest version of @swc/core and @swc/plugin-styled-components, and never encountered incompatibility, since before that you apparently updated the versions of swc_core simultaneously.

@kdy1
Copy link
Member

kdy1 commented Nov 4, 2024

swc-project/swc#9711

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants