0
I couldn’t use Graphql Codegen’s client-preset-swc-plugin
with Vite at all to reduce the bundle size. It panics when trying to build for production, I’m getting this error:
[vite-plugin-pwa:build] failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("/home/user/project/web/src/index.tsx")'
Caused by:
0: failed to invoke `/home/user/project/web/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm` as js transform plugin at /home/user/project/web/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm
1: RuntimeError: unreachable
at <unnamed> (<module>[707]:0x89c35)
at <unnamed> (<module>[637]:0x8654f)
at <unnamed> (<module>[713]:0x8a2b8)
at <unnamed> (<module>[712]:0x8a1f1)
at <unnamed> (<module>[480]:0x728f1)
at <unnamed> (<module>[30]:0x266e)
at <unnamed> (<module>[29]:0x2621)
at <unnamed> (<module>[120]:0x20ceb)
at <unnamed> (<module>[117]:0x1cf7b)
at <unnamed> (<module>[140]:0x2ce18)
at <unnamed> (<module>[52]:0x78f0)
at <unnamed> (<module>[411]:0x6c135)
at <unnamed> (<module>[854]:0x9354d)
file: /home/user/project/web/src/index.tsx
error during build:
Error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("/home/user/project/web/src/index.tsx")'
How can I fix this? Is there any alternative?
My module versions:
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@graphql-codegen/client-preset-swc-plugin": "^0.2.0",
"@vitejs/plugin-react-swc": "^3.2.0",
"vite": "^4.4.9",
"vite-plugin-pwa": "^0.16.4",