-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In wasm-bindgen 0.2.84 version, webpack cannot generate wasm files #3276
Comments
I've noticed this as well, In my case, the files are being generated but they are invalid, and any use of them results in a javascript |
…ression This regression rendered the OptiVorbis web demo unusable. Upstream issue: rustwasm/wasm-bindgen#3276
I can reproduce this issue on my project too. Trying to use the WASM module from JS in a development server throws a |
This seems to be a bug in Webpack, triggered by #3152. As a workaround, switching to dynamically importing the wasm-bindgen shim fixes it for some reason. |
It turns out this is happening because (So, it's not a Webpack bug, I was a bit quick to assume that.) I've opened rustwasm/wasm-pack#1224 to fix this. @alexcrichton or @drager, could you take a look at that PR? |
Ah sorry, I don't manage the |
Yeah, I will take a look soon. Thanks for looking into and fixing it! |
I tried setting everything back to 0.2.83, by running these steps in this order (after some trial and error):
And then built it with rustc 1.67.1, making sure that the old versions were indeed the ones that were compiled... But it still didn't solve the issue I ran into in #3306. |
I can't reproduce this. Could you give more detailed instructions? |
I've updated and uploaded my MRE: I've made a few more changes, up to here: cryptoquick/wasm-bindgen-mre@ee313c0 Still not working, same error as in README, not sure what else I can do... I'm sure the cache is clearing too, since each time, I test with a different port on my local server. |
That repo isn't demonstrating the original issue that you had in #3306, it's a completely separate issue which is occurring because you're not running The original problem was with |
I have this exact issue, as soon as I upgrade to web_sys 0.3.61 from 0.3.60 any call to a Rust function from JavaScript results in an undefined error like:
( |
I get issues with my own functions, or some stack pointer calls, such as |
I actually updated the comment you responded to only a few minutes after I posted it. Please take another look. |
@Liamolucko I just took another look at my code and realized what you were explaining. I've fixed it and the MRE passes, so you are correct in that it is no longer relevant to this discussion. |
This is now fixed in |
* Fixed the HDR Histogram build for webpack - rustwasm/wasm-bindgen#3276 (comment) - rustwasm/wasm-pack#1224 * Updated Viewer dependencies
Steps to Reproduce
I created a repo with the problem here
Step1:
npm run i
Step2:
wasm-pack build
Step3:
npm run build
A dist dir contain index.js and wasm file will be generated in the project root; It is expected behavior.
When i change the wasm-bindgen version to 0.2.84 and run
rm -r pkg && wasm-pack build && npm run build
In dist dir, webpack doesn't generate wasm files.
The text was updated successfully, but these errors were encountered: