You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing the wasm-pack with a project that I'm doing of implement Conway's in WASM. Everything went well when I was packing the Rust with wasm-pack, after packing I published it on npm (it can be found here), but when I tried to use the pack in my js project this error has been thrown:
ERROR in ./index.js
Module not found: Error: Can't resolve 'conways_game_of_life' in 'C:\Users\Gabriel\Projetos\Conways-Game-of-Life\wasm-test'
@ ./index.js 1:11-42
index.js:
import * as wasm from 'conways_game_of_life'
// At moment I'm just trying to see what is imported
console.log(wasm)
The RUST code is here, it is working when I use it as the hello world exemple of wasm-bindgen, with import(...).
How am I supposed to import packages generated by wasm-pack?
The text was updated successfully, but these errors were encountered:
I soved it, the wasm-pack doesn't create the index.js file, so i need to require an expecific file, the correct import is const wasm = import('conways_game_of_life/conways_game_of_life')
I'm testing the wasm-pack with a project that I'm doing of implement Conway's in WASM. Everything went well when I was packing the Rust with wasm-pack, after packing I published it on npm (it can be found here), but when I tried to use the pack in my js project this error has been thrown:
index.js:
The RUST code is here, it is working when I use it as the hello world exemple of wasm-bindgen, with
import(...)
.How am I supposed to import packages generated by wasm-pack?
The text was updated successfully, but these errors were encountered: