-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing raw wasm module typescript declaration files in package.json
#1193
Comments
3 tasks
scristobal
changed the title
Missing typescript declaration files in
Missing raw wasm module typescript declaration files in Nov 13, 2022
package.json
package.json
kimwallmark
pushed a commit
to kimwallmark/rustwasm_book
that referenced
this issue
Apr 9, 2023
wasm_game_of_life_bg.js and wasm_game_of_life_bg.wasm.d.ts are now being generated by `wasm-pack build`. There is some additional information about these files in rustwasm/wasm-pack#199 and rustwasm/wasm-pack#1193 .
This was referenced Apr 9, 2023
Any updates on this issue? Just ran into the problem myself trying to use a package. If there is anything I can do to help would be more than glad to. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
馃悰 Bug description
When importing a NPM module generated by wasm-pack, typescript is unable to find declarations for the raw wasm module.
馃 Expected Behavior
The file
{name_prefix}_bg.wasm.d.ts
should be included inpackage.json
so that typescript can find the types.馃憻 Steps to reproduce
I followed the Rust-WASM book, and published the package to NPM as described in https://rustwasm.github.io/docs/book/game-of-life/publishing-to-npm.html
In a separate project import the module from NPM and attempt to access
memory
as in the book withconst { memory } = await import('example-pkg/example-pkg_wasm_bg.wasm');
typescript is unable to find the type declarations.
馃實 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.10.3
rustc version: 1.65.0 (897e37553 2022-11-02)
The text was updated successfully, but these errors were encountered: