编译器损坏/线程'<unnamed>'在'无法调用插件时恐慌:无法调用插件

问题描述 投票:0回答:0

我正在为下一个 js 创建一个 SWC 插件。很多天来,我一直在编译和运行我的插件,没有错误。

我没有做任何更改,但我的插件在下一个 js 中停止工作。我编译的任何插件都会抛出错误。甚至是文档中的一个空插件。 https://swc.rs/docs/plugin/ecmascript/getting-started

我在我的电脑上重新安装了 Rust。尝试了不同版本的铁锈。问题依然存在

问题不在下一个js。我以前版本的插件有效。没有编译错误。

以下是错误的全文。请帮助解决问题。我保持联系并准备提供任何信息。

附言SWC 插件在 Rust 中创建并编译成 webassembly

thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("C:\\Users\\79833\\WebstormProjects\\TestSWC\\nextnew\\node_modules\\next
\\dist\\shared\\lib\\router\\router.js")'

Caused by:
    0: failed to invoke `C:\Users\79833\WebstormProjects\TestSWC\nextnew\my_first_plugin.wasm` as js transform plugin at C:\Users\79833\WebstormProjects\TestSWC\ne
xtnew\my_first_plugin.wasm
    1: RuntimeError: out of bounds memory access
           at memcpy (<module>[981]:0xeb13d)
           at <swc_atoms::EncodeJsWord as rkyv::with::DeserializeWith<<alloc::string::String as rkyv::Archive>::Archived,string_cache::atom::Atom<swc_atoms::JsWord
StaticSet>,D>>::deserialize_with::h3dad2a49853b7fb5 (<module>[242]:0x35082)
           at swc_ecma_ast::pat::_::<impl rkyv::Deserialize<swc_ecma_ast::pat::Pat,__D> for <swc_ecma_ast::pat::Pat as rkyv::Archive>::Archived>::deserialize::h9f0
673eeadbbf3c8.3012 (<module>[547]:0x932a3)
           at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h51594e0d44770242 (<module>[258]:0x3be93)
           at rkyv::impls::alloc::boxed::<impl rkyv::Deserialize<alloc::boxed::Box<T>,D> for rkyv::boxed::ArchivedBox<<T as rkyv::ArchiveUnsized>::Archived>>::dese
rialize::hde70bd1682ee49e9 (<module>[310]:0x49e8e)
           at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize:
:h7e5af938a6376db0.2768 (<module>[400]:0x63dfa)
           at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::he24698ee79b4671e (<module>[53]:0xcbee)
           at rkyv::impls::alloc::boxed::<impl rkyv::Deserialize<alloc::boxed::Box<T>,D> for rkyv::boxed::ArchivedBox<<T as rkyv::ArchiveUnsized>::Archived>>::dese
           at swc_ecma_ast::decl::_::<impl rkyv::Deserialize<swc_ecma_ast::decl::Decl,__D> for <swc_ecma_ast::decl::Decl as rkyv::Archive>::Archived>::deserialize:
:hc558b8b92ea0f1e4 (<module>[250]:0x36e02)
           at swc_ecma_ast::stmt::_::<impl rkyv::Deserialize<swc_ecma_ast::stmt::Stmt,__D> for <swc_ecma_ast::stmt::Stmt as rkyv::Archive>::Archived>::deserialize:
:h7e5af938a6376db0 (<module>[249]:0x368b5)
           at rkyv::impls::core::<impl rkyv::DeserializeUnsized<[U],D> for [T]>::deserialize_unsized::h541fb5d390ec45a8 (<module>[51]:0xba5e)
           at __transform_plugin_process_impl (<module>[50]:0xa049)
           at __transform_plugin_process_impl.command_export (<module>[989]:0xeb920)
    2: heap_get_oob', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\swc-0.260.41\src\plugin.rs:219:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
rust next.js webassembly swc swc-compiler
© www.soinside.com 2019 - 2024. All rights reserved.