Git Product home page Git Product logo

Comments (12)

xc2 avatar xc2 commented on September 26, 2024 2

tracking list of panic cases related to swc-plugins:

from rspack.

h-a-n-a avatar h-a-n-a commented on September 26, 2024 2

Thanks for reporting this issue to us.
This happens if the plugin's SWC version not compatible with rspack's. There's an AST breaking change introduced in the latest version of swc. For SWC version in rspack 0.5.8, you may now use plugins of version 1.5.113. We would add some version checks to prevent this and guide user to use the corresponding version.

from rspack.

h-a-n-a avatar h-a-n-a commented on September 26, 2024 2

Thanks @h-a-n-a, I'm not clear on what the 1.5.113 version refers to and is this a change the plugin maintainers would need to make?

Thanks for reaching out. It's the version of official plugins provided by swc. For current Rspack version v0.5.8, If It's provided by the third party author, You have to check if the crate swc_core version of that wasm plugin is between 0.88.x ~ 0.89.x.

The biggest difference between @swc/core (the npm package), which is used with swc-loader and builtin:swc-loader is the prior option allows you to switch the suitable @swc/core version, however the latter one doesn't.

from rspack.

h-a-n-a avatar h-a-n-a commented on September 26, 2024 1

Ok, so for swc-plugin-coverage-instrument

swc_core           = { version = "0.90.7" }

So that means I would need to wait for an rspack update to use that plugin because there's an API breaking change in SWC?

Yes, or you can downgrade to plugin of the version within that range.

from rspack.

chenjiahan avatar chenjiahan commented on September 26, 2024

@h-a-n-a cc~

from rspack.

esturcke avatar esturcke commented on September 26, 2024

Seeing a runtime panic when trying to use https://github.com/kwonoj/swc-plugin-coverage-instrument:

● Client ━━━━━━━━━━━━━━━━━━━━━━━━━ (50%) building /.../node_modules/validator/lib/isFloat.js                                                                                                                  Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  failed to invoke plugin: failed to invoke plugin on 'Some("/.../src/app/application.tsx")'

Caused by:
    0: failed to invoke `swc-plugin-coverage-instrument` as js transform plugin at swc-plugin-coverage-instrument
    1: RuntimeError: out of bounds memory access
Location: /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.272.6/src/plugin.rs:162

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1: _napi_register_module_v1
    at <unknown source file>
 2: _napi_register_module_v1
    at <unknown source file>
 3: _napi_register_module_v1
    at <unknown source file>
 4: _napi_register_module_v1
    at <unknown source file>
 5: _napi_register_module_v1
    at <unknown source file>
 6: _wasmer_vm_imported_memory32_atomic_notify
    at <unknown source file>
 7: _wasmer_vm_imported_memory32_atomic_notify
    at <unknown source file>
 8: _napi_register_module_v1
    at <unknown source file>
 9: _napi_register_module_v1
    at <unknown source file>
10: _napi_register_module_v1
    at <unknown source file>
11: _napi_register_module_v1
    at <unknown source file>
12: _napi_register_module_v1
    at <unknown source file>
13: _napi_register_module_v1
    at <unknown source file>
14: _napi_register_module_v1
    at <unknown source file>
15: _napi_register_module_v1
    at <unknown source file>
...

from rspack.

esturcke avatar esturcke commented on September 26, 2024

Thanks @h-a-n-a, I'm not clear on what the 1.5.113 version refers to and is this a change the plugin maintainers would need to make?

from rspack.

huhuaaa avatar huhuaaa commented on September 26, 2024

@h-a-n-a I have a similar problem. If using other plugins like swc-plugin-auto-css-modules, how do I choose which version to use? Is there any corresponding guidance for the swc version used by rspack?

from rspack.

esturcke avatar esturcke commented on September 26, 2024

Ok, so for swc-plugin-coverage-instrument

swc_core           = { version = "0.90.7" }

So that means I would need to wait for an rspack update to use that plugin because there's an API breaking change in SWC?

from rspack.

esturcke avatar esturcke commented on September 26, 2024

I tried a few versions of swc-plugin-coverage-instrument but they seem to all cause an error during build. I think I can use babel-plugin-istanbul in the mean time (build time goes up from 15s to 2min :) but we don't need coverage builds as often).

Thanks for all the work on rspack, it's been so much easier to migrate from webpack than vite and performance is incredible.

from rspack.

h-a-n-a avatar h-a-n-a commented on September 26, 2024

I tried a few versions of swc-plugin-coverage-instrument but they seem to all cause an error during build. I think I can use babel-plugin-istanbul in the mean time (build time goes up from 15s to 2min :) but we don't need coverage builds as often).

Thanks for all the work on rspack, it's been so much easier to migrate from webpack than vite and performance is incredible.

@esturcke We're going to release a minor version of rspack next week. In this version, we bumped swc_core to the latest version, which should support the latest version of swc-plugin-coverage-instrument. #6009.

from rspack.

h-a-n-a avatar h-a-n-a commented on September 26, 2024

This issue would be closed. For followup plugin selections, please refer to https://swc.rs/docs/plugin/selecting-swc-core.

from rspack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.