swc-plugin-coverage-instrument
swc-plugin-coverage-instrument copied to clipboard
There will be an error when building with swc-core 1.7.0 version
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 'Result::unwrap() on an Err value: LayoutError
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
thread '
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
same issue here
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).
There's a PR https://github.com/kwonoj/swc-plugin-coverage-instrument/pull/243 but it is not passing CI yet.
There's a PR #243 but it is not passing CI yet.
#243 test is passed on local. Not understand why it's failed...
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