Skip to content
New issue

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

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

Already on GitHub? # to your account

wasm_bindgen(module="...") #32

Open
dingari opened this issue May 17, 2024 · 0 comments
Open

wasm_bindgen(module="...") #32

dingari opened this issue May 17, 2024 · 0 comments

Comments

@dingari
Copy link

dingari commented May 17, 2024

I'm unable to use `wasm_bindgen(module="...") to call JS functions from Rust. I updated the example with a simple demo. This is the error I get:

Failed to resolve import "./snippets/my-crate-0d724ede9b1bbc82/demo.js" from "@vite-plugin-wasm-pack@my-crate". Does the file exist?
11:44:12 AM [vite] Internal server error: Failed to resolve import "./snippets/my-crate-0d724ede9b1bbc82/demo.js" from "@vite-plugin-wasm-pack@my-crate". Does the file exist?
  Plugin: vite:import-analysis
  File: @vite-plugin-wasm-pack@my-crate
  1  |  import { demo } from './snippets/my-crate-0d724ede9b1bbc82/demo.js';
     |                        ^
  2  |
  3  |  let wasm;
      at formatError (/Users/genki/development/scratch/vite-plugin-wasm-pack/example/node_modules/.pnpm/vite@2.9.18/node_modules/vite/dist/node/chunks/dep-0a035c79.js:39080:46)
      at TransformContext.error (/Users/genki/development/scratch/vite-plugin-wasm-pack/example/node_modules/.pnpm/vite@2.9.18/node_modules/vite/dist/node/chunks/dep-0a035c79.js:39076:19)
      at normalizeUrl (/Users/genki/development/scratch/vite-plugin-wasm-pack/example/node_modules/.pnpm/vite@2.9.18/node_modules/vite/dist/node/chunks/dep-0a035c79.js:58365:26)
      at async TransformContext.transform (/Users/genki/development/scratch/vite-plugin-wasm-pack/example/node_modules/.pnpm/vite@2.9.18/node_modules/vite/dist/node/chunks/dep-0a035c79.js:58514:57)
      at async Object.transform (/Users/genki/development/scratch/vite-plugin-wasm-pack/example/node_modules/.pnpm/vite@2.9.18/node_modules/vite/dist/node/chunks/dep-0a035c79.js:39317:30)
      at async doTransform (/Users/genki/development/scratch/vite-plugin-wasm-pack/example/node_modules/.pnpm/vite@2.9.18/node_modules/vite/dist/node/chunks/dep-0a035c79.js:50048:29)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant