pmndrs / swc-jotai

MIT License
90 stars 14 forks source link

Broken on default version of Vite #23

Closed jaens closed 2 months ago

jaens commented 7 months ago

After @vitejs/plugin-react-swc changed their version to 3.6.0 (which, I assume, contains an swc upgrade), every compilation fails with:

0: failed to invoke `...../node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm` 
    as js transform plugin at ..../node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm
    1: RuntimeError: unreachable
           at <unnamed> (<module>[1290]:0x71005)
           .....

Might be related to #22.

trustedtomato commented 6 months ago

Experiencing the same issue. I'm also looking for a project with working Vite+React+@vitejs/plugin-react-swc so that I can copy the version numbers. I have tried overwriting plugin-react-swc to use @swc/core 1.3.105 (using package.json overrides), but the error remained, so I guess the error is coming from somewhere else.

jaens commented 6 months ago

@vitejs/plugin-react-swc v3.5.0 still works with current version of Vite (v5.1.1) , so pinning that version is a workaround, for now.

adamelliotfields commented 6 months ago

This is currently working for me:

{
  "type": "module",
  "devDependencies": {
    "@swc-jotai/react-refresh": "0.1.0",
    "@tsconfig/vite-react": "3.0.0",
    "@types/node": "20",
    "@types/react": "18.2",
    "@types/react-dom": "18.2",
    "@vitejs/plugin-react-swc": "3.5.0",
    "typescript": "5.3.3",
    "vite": "5.1.2"
  },
  "overrides": {
    "@swc/core": "1.3.105"
  }
}
Thisen commented 2 months ago

I expect this to be a @vitejs/plugin-react-swc issue, but feel free to reopen if it persists with latest versions.