Open chenyulun opened 3 weeks ago
https://plugins.swc.rs/versions/range/18 swc_core
@0.106.0 - *
change swc_core
to 0.106.3
, like lingui_macro_plugin
maybe 👇🏻?
[package]
authors = ["xxXyh1908 <15626874924@163.com>"]
edition = "2021"
license = "MIT"
name = "swc_plugin_transform_vue3_jsx"
version = "0.3.0"
[lib]
crate-type = ["cdylib", "rlib"]
name = "swc_plugin_transform_vue3_jsx"
[workspace]
members = ["playground", "folder"]
[profile.release]
lto = true
opt-level = 2
[dependencies]
serde = "1"
serde_json = "1"
swc_core = {version = "0.106.4", features = [
"ecma_plugin_transform",
"ecma_visit",
"ecma_ast",
"common",
]}
vue3_jsx_folder = {path = "./folder"}
# .cargo/config defines few alias to build plugin.
# cargo build-wasi generates wasm-wasi32 binary
# cargo build-wasm32 generates wasm32-unknown-unknown binary.
error[E0599]: no method named set_span found for mutable reference &mut swc_core::ecma::ast::IdentName in the current scope
--> folder/src/visitor_helpers.rs:1437:43 |
1437 | PropName::Ident(name) => name.set_span(_span), | ^^^^^^^^ |
---|
= help: items from traits can only be used if the trait is implemented and in scope
note: AstSpanAccessor
defines an item set_span
, perhaps you need to implement it
....
Some errors have detailed explanations: E0061, E0063, E0277, E0308, E0412, E0432, E0560, E0599, E0609.
For more information about an error, try rustc --explain E0061
.
warning: vue3_jsx_folder
(lib) generated 6 warnings
error: could not compile vue3_jsx_folder
(lib) due to 75 previous errors; 6 warnings emitted
warning: build failed, waiting for other jobs to finish...
swc_core = {version = "0.109", features = [
"ecma_utils",
"ecma_visit",
"ecma_ast",
"ecma_quote",
"common",
"base",
]}
很多节点需要添加ctxt: SyntaxContext::empty()
但是我不知道SyntaxContext::empty()
对不对
workspace: /Users/myname/github/swc-plugin-transform-vue3-jsx/Cargo.toml
Compiling proc-macro2 v1.0.89
Fresh unicode-ident v1.0.13
Fresh version_check v0.9.5
Fresh autocfg v1.4.0
Fresh wasi v0.11.0+wasi-snapshot-preview1
Fresh rand_core v0.6.4
Running /Users/myname/github/swc-plugin-transform-vue3-jsx/target/release/build/proc-macro2-aa7c211a991b9f6f/build-script-build
error: failed to run custom build command for proc-macro2 v1.0.89
Caused by:
process didn't exit successfully: /Users/myname/github/swc-plugin-transform-vue3-jsx/target/release/build/proc-macro2-aa7c211a991b9f6f/build-script-build
(signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
Describe the bug
● ━━━━━━━━━━━━━━━━━━━━━━━━━ (10%) building /Users/chenyulun390/learn/rspack-vue3-jsx/node_modules/.pnpm/@rspack+core@1.0.14/node_modules/@rspack/core/hot/dev-server.js thread '' panicked at 'called
Result::unwrap()
on anErr
value: LayoutError', C:\Users\xyh.cargo\registry\src\mirrors.sjtug.sjtu.edu.cn-7a04d2510079875b\rkyv-0.7.37\src\impls\core\mod.rs:265:67 note: run withRUST_BACKTRACE=1
environment variable to display a backtrace 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("/Users/chenyulun390/learn/rspack-vue3-jsx/src/main.jsx")'Caused by: 0: failed to invoke
swc-plugin-transform-vue3-jsx
as js transform plugin at swc-plugin-transform-vue3-jsx 1: failed to run Wasm plugin transform. Please ensure the version ofswc_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 updateswc_core
to the compatible version.Location: index.crates.io-6f17d22bba15001f/swc-1.0.0/src/plugin.rs:170
Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets.
playground-url
https://github.com/rspack-contrib/rspack-examples/tree/main/rspack/vue3-jsx
Expected generated code