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

[Bug]: Rspack v1.2.0-alpha.0 compatability with @swc/plugin-formatjs #8910

Open
rrosenshain-sc opened this issue Dec 31, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@rrosenshain-sc
Copy link

System Info

 System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 80.34 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 8.15.6 - ~/.nvm/versions/node/v20.11.0/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.2
  npmPackages:
    @rspack/cli: ^1.1.8 => 1.1.8 
    @rspack/core: 1.2.0-alpha.0 => 1.2.0-alpha.0 
    @rspack/plugin-react-refresh: ^1.0.1 => 1.0.1 

Details

I'm trying to use @swc/plugin-formatjs with v1.2.0-alpha.0
Seems like it was shipped with swc_core 9.0.2 while the swc-plugin uses 9.0.0 (https://github.com/swc-project/plugins/blob/main/Cargo.toml#L49)

My rspack config has something like

            experimental: {
              plugins: [['@swc/plugin-formatjs', {}]],
            },

Getting:

 × Module build failed:
  ╰─▶   ×
        │   ⚠
        │   │                     [React Intl] Message failed to parse.
        │   │                     See: https://formatjs.io/docs/core-concepts/icu-syntax
        │   │                     \n {:#?}
        │   │
        │
        │   × SyntaxError: UNCLOSED_TAG
        │ The version of the SWC Wasm plugin you're using might not be compatible with `builtin:swc-loader`.
        │ The `swc_core` version of the current `rspack_core` is =9.0.2.
        │ Please check the `swc_core` version of SWC Wasm plugin to make sure these versions are within the compatible range.
        │ See this guide as a reference for selecting SWC Wasm plugin versions: https://rspack.dev/errors/swc-plugin-version

I read the docs around version compatibility but:

  1. The rspack alpha version doesn't show up
  2. Once I realized the swc_core needs to match is when I bumped from 1.1.8 to 1.2.0 alpha but I didn't imagine the minor versions need to match as well - does that mean I need to just wait?
  3. It sounds pretty hard to manage dependencies that way - should I use the swc-loader instead until there's a better way?
    Like, maybe there a way to trigger a swc plugins compilation using the rspack swc_core version? Or re-build the plugins on every swc_core release?

Reproduce link

No response

Reproduce Steps

rspack serve

@rrosenshain-sc rrosenshain-sc added bug Something isn't working pending triage The issue/PR is currently untouched. labels Dec 31, 2024
@kdy1
Copy link

kdy1 commented Dec 31, 2024

It’s not a compatibility error. Please read the error message. It’s a SyntaxError from the Wasm plugin.

@rrosenshain-sc
Copy link
Author

Ok Thanks - Gonna close for now.
Although it would be ideal if there wasn't the compatibility message throwing me off :)
I wasn't sure if 9.0.0 should be compatible with 9.0.2.

@hardfist hardfist reopened this Jan 1, 2025
@hardfist hardfist self-assigned this Jan 1, 2025
@hardfist
Copy link
Contributor

hardfist commented Jan 1, 2025

its still rspack bug,gonna fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

3 participants