Menci / vite-plugin-wasm

Add WebAssembly ESM integration (aka. Webpack's `asyncWebAssembly`) to Vite and support `wasm-pack` generated modules.
MIT License
292 stars 17 forks source link

build error "Could not find a declaration file for module 'vite-plugin-wasm'" #36

Closed hongshu7 closed 10 months ago

hongshu7 commented 1 year ago

My development and testing are working fine, but an error occurs during the build, which says:

Could not find a declaration file for module 'vite-plugin-wasm'. '/project/path/node_modules/vite-plugin-wasm/exports/import.mjs' implicitly has an 'any' type.
  There are types at '/project/path/node_modules/vite-plugin-wasm/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vite-plugin-wasm' library may need to update its package.json or typings.
mrhoodz commented 1 year ago

Ive bumped into this before when l bundled my rust to wasm with wasm-pack. If you are in that spot do, the following worked for me.