swc-plugin-coverage-instrument icon indicating copy to clipboard operation
swc-plugin-coverage-instrument copied to clipboard

There will be an error when building with swc-core 1.7.0 version

Open travzhang opened this issue 1 year ago • 4 comments

https://github.com/canyon-project/canyon/blob/94ebe1ed20b80d0b9128e8f90da66db445be71b1/packages/canyon-platform/vite.config.ts#L12 This is my SWC plugin configuration. When I use the latest swc-core(1.7.0), there will be an error message.

transforming (1) index.htmlthread '' panicked at /Users/ojkwon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.44/src/impls/core/mod.rs:266:67: called Result::unwrap() on an Err value: LayoutError note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread '' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.282.0/src/plugin.rs:169:14: failed to invoke plugin: failed to invoke plugin on 'Some("/Users/zhangtao/github.com/canyon-project/canyon/packages/canyon-platform/src/main.tsx")'

Caused by: 0: failed to invoke /Users/zhangtao/github.com/canyon-project/canyon/node_modules/.pnpm/[email protected]/node_modules/swc-plugin-coverage-instrument/target/wasm32-wasi/release/swc_plugin_coverage.wasm as js transform plugin at /Users/zhangtao/github.com/canyon-project/canyon/node_modules/.pnpm/[email protected]/node_modules/swc-plugin-coverage-instrument/target/wasm32-wasi/release/swc_plugin_coverage.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 https://swc.rs/docs/plugin/selecting-swc-core 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.
2: RuntimeError: unreachable

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

travzhang avatar Jul 18 '24 09:07 travzhang

same issue here

JiangWeixian avatar Aug 18 '24 09:08 JiangWeixian

From what i can see in the compatibility table, this plugin is not yet compatible with @swc/core v1.7.0 (https://plugins.swc.rs/versions/range/16). The latest version supported seems to be 1.6.7 (https://plugins.swc.rs/versions/range/15).

astik avatar Sep 13 '24 15:09 astik

There's a PR https://github.com/kwonoj/swc-plugin-coverage-instrument/pull/243 but it is not passing CI yet.

kwonoj avatar Sep 14 '24 04:09 kwonoj

There's a PR #243 but it is not passing CI yet.

#243 test is passed on local. Not understand why it's failed...

JiangWeixian avatar Sep 16 '24 06:09 JiangWeixian

There's a PR #243 but it is not passing CI yet.

#243 test is passed on local. Not understand why it's failed...

maybe forget to update @swc/core 1.7.x in package.json? ref

ERUIHNIYHBKBNF avatar Sep 25 '24 05:09 ERUIHNIYHBKBNF