-
Notifications
You must be signed in to change notification settings - Fork 338
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
Custom wasm
file not loading correctly in Nuxt apps
#428
Comments
Looks like there's a mismatch between the version of the WASM binary and the js code. Each version of zxing-wasm (an indirect dependency of this lib) has an associated WASM binary file that is incompatible with other versions. You should make sure you use the correct version of the WASM binary when you want to serve it yourself. The DX is not very good for users who want to host their WASM files themselves, I'm open to all kinds of suggestions to make this less an issue. |
Ideally, a user of |
Thanks both for the quick reply, I really appreciate it! @Sec-ant suggestion fixed it! I really thought I had to correct the version 🙈 But I agree with @dargmuesli, it'd be good to have the file imported along with the lib so there's no mismatch. This setup creates some implicit knowledge in the team, and even if it's documented in code, someone might update the package and not realize they are breaking things. |
Should we maybe keep this issue open to track adding an import for |
Sure, I closed it as it wasn't a bug but feel free to reopen it 👍 From what I read in the original issue, one thing about this setup is that the reason to not include the Would it be possible to include it in the package but defer the import so it doesn't take up the initial bundle weight and block critical resources? In our implementation, we already have |
This issue has been marked as stale. If there is no further activity it will be closed. |
@gruhn could we mark this tracking issue in a way that it isn't closed automatically? |
Not sure. I can remove the label but I think it will be re-added in awhile. |
On the documentation page for the action you've added that manages stale items, there are various configuration options on how to exempt items from the automation: https://github.com/actions/stale?tab=readme-ov-file For example, the exempt-issue-labels or exempt-issue-assignees option could be configured. |
Just discovered this stage 3 ESM proposal, which might help streamline WASM imports. |
Describe the bug
Based on the sample code provided in this issue #354 by @Sec-ant, providing the URL for a self-hosted file should work.
I've added the
wasm
file as a static file of a Nuxt project as our CSP rules are pretty strict.The camera is active, but the reader fails to execute.
The implementation is what's provided in the minimal reproduction setup below. Is that incorrect?
To Reproduce
https://stackblitz.com/edit/github-ptbbrj?file=app.vue
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: