Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

https://wiki.developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_wasm #3256

Closed
1 task done
hanshou101 opened this issue May 19, 2020 · 1 comment
Closed
1 task done
Labels
Content:JS This is related to JavaScript content

Comments

@hanshou101
Copy link

hanshou101 commented May 19, 2020

Request type

  • Correction or update

Details

In the [wasm-pack: 0.9.1] library, a bug appeared:

After the pkg folder is generated, the [files] attribute of the package.json file is missing the following file name:

"hello_wasm_bg.js", "hello_wasm_bg.d.ts"


This will directly lead to the error

Can't resolve './hello_wasm_bg.js'

when pkg is used

wasm-pack build --target bundler not including *_bg.js file in package.json · Issue #837 · rustwasm/wasm-pack


At present, the official has fixed this problem,
But no new release package has been released.
Corrected files included in package.json for bundler / no target (#837) by lucashorward · Pull Request #839 · rustwasm/wasm-pack


Solutions

We need to manually add these two file names to the package.json in the [pkg] folder.

@Elchi3 Elchi3 added Content Content:JS This is related to JavaScript content labels May 19, 2020
@chrisdavidmills
Copy link
Contributor

Thanks for reporting this @hanshou101 . Would you be interested in adding a note to the page to cover this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:JS This is related to JavaScript content
Projects
None yet
Development

No branches or pull requests

3 participants