Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("vueJsx.jsx")' #2

Closed
ja-plus opened this issue Mar 29, 2023 · 9 comments

Comments

@ja-plus
Copy link

ja-plus commented Mar 29, 2023

*  Executing task: npm run vueJsx 


> swc@1.0.0 vueJsx
> swc ./vueJsx.jsx -o vueJsx.out.js

Successfully compiled 1 file with swc.
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: npm run vueJsx 


> swc@1.0.0 vueJsx
> swc ./vueJsx.jsx -o vueJsx.out.js

thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("vueJsx.jsx")'

Caused by:
    0: failed to invoke `swc-plugin-vue-jsx` as js transform plugin at node_modules\swc-plugin-vue-jsx\swc_plugin_vue_jsx.wasm
    1: RuntimeError: out of bounds memory access
           at <unnamed> (<module>[1429]:0xf8502)
           at <unnamed> (<module>[1462]:0x102a10)
    2: heap_get_oob', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\swc-0.255.18\src\plugin.rs:228:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("vueJsx.jsx")'

Caused by:
    0: failed to invoke `swc-plugin-vue-jsx` as js transform plugin at node_modules\swc-plugin-vue-jsx\swc_plugin_vue_jsx.wasm
    1: RuntimeError: out of bounds memory access
           at <unnamed> (<module>[1429]:0xf8502)
           at <unnamed> (<module>[1462]:0x102a10)
    2: heap_get_oob
Error: Failed to compile 1 file with swc.
    at Object.assertCompilationResult (D:\html-test\tool-test\swc\node_modules\@swc\cli\lib\swc\util.js:149:15)
    at files (D:\html-test\tool-test\swc\node_modules\@swc\cli\lib\swc\file.js:201:19)
    at async _default (D:\html-test\tool-test\swc\node_modules\@swc\cli\lib\swc\file.js:220:9)

 *  The terminal process "C:\Users\viruser.v-desktop\AppData\Local\Programs\Git\bin\bash.exe '--login', '-i', '-c', 'npm run vueJsx'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

.swcrc

{
  "env": {
    "targets": {
      "chrome": "49"
    },
    "mode": "usage",
    "coreJs": "3.29",
  },
  "jsc": {
    "parser": {
      "syntax": "ecmascript", // 'typescript'
      "jsx": true
    },
    "externalHelpers": true,
    "experimental": {
      "plugins": [
        [
          "swc-plugin-vue-jsx",
          {}
        ]
      ]
    }
  },
}

dependencies

 "devDependencies": {
    "@swc/cli": "^0.1.62",
    "@swc/core": "^1.3.42",
    "@swc/helpers": "^0.4.14",
    "browserslist": "^4.21.3",
    "core-js": "^3.29.1",
    "swc-plugin-vue-jsx": "^0.2.1"
  },
  "dependencies": {
    "vue": "^3.2.47"
  }

How to use the plugin. Is there something I done error?

@g-plane
Copy link
Owner

g-plane commented Mar 29, 2023

Would you like to create a reproduction repository? Thanks.

@RiESAEX
Copy link

RiESAEX commented Mar 31, 2023

Having the same problem, I will try to update swc_core and see if that fixes the problem.
It works after I update swc_core to 0.72.8. I think it is caused by swc-project/swc#7170
image

@g-plane do you want a pr?

@g-plane
Copy link
Owner

g-plane commented Apr 10, 2023

Will updating SWC fix this bug?

@ja-plus
Copy link
Author

ja-plus commented Apr 11, 2023

e....
I update swc to @swc/core@1.3.49
Still show that error.

devDependencies": {
    "@swc/cli": "^0.1.62",
    "@swc/core": "^1.3.49", // updated
    "@swc/helpers": "^0.5.0", // updated
    "browserslist": "^4.21.3",
    "core-js": "^3.29.1",
    "swc-plugin-vue-jsx": "^0.2.1"

How you guys did that😥

@g-plane
Copy link
Owner

g-plane commented Apr 11, 2023

No. SWC should be updated at plugin-side, not your project.

@g-plane
Copy link
Owner

g-plane commented Apr 11, 2023

Please try v0.2.2.

@ja-plus
Copy link
Author

ja-plus commented Apr 12, 2023

swc-plugin-vue-jsx@0.2.2
solved this problem.
thanks!

@baiyuze
Copy link

baiyuze commented Aug 26, 2023

Now I occasionally report this error, in addition, I also report that swc-plugin-vue-jsx cannot adjust swc-plugin-vue-jsx, and the more complicated jsx directly leads to failure to compile, exit directly, or report some utf8 error

@baiyuze
Copy link

baiyuze commented Aug 26, 2023

我用的是swc-loader来使用这个插件的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants