Skip to content
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

Handle delay when intialising wasm module #50

Open
louisfoster opened this issue Sep 16, 2022 · 2 comments
Open

Handle delay when intialising wasm module #50

louisfoster opened this issue Sep 16, 2022 · 2 comments

Comments

@louisfoster
Copy link

If you run decode immediately after creating the WebpMachine, in some browsers this will cause an error like: Module.asm is undefined. This is because the wasm module is still loading. I fixed this in my code by adding a short delay after creating WebpMachine, however it would be cleaner if there was a way (such as promise/callback) to ensure the module has loaded, or force the decode function to wait.

I will attempt to look into this when I have time.

@chase-moskal
Copy link
Owner

hello! thanks for contributing! this sounds like a serious issue you've raised, we'd certainly like to solve it as properly as we can.

if you want to dig into the code:

  • be aware of the new work in the conditionally branch, which we intend to merge and release soon
  • this branch introduces a new conditional loader and easier html-only installation instructions
  • see the new readme installation instructions
  • see the new conditionally.ts script
  • we'd be happy to have your review

@chase-moskal
Copy link
Owner

i'll add: hopefully i'll have some time in the next couple weeks to merge conditionally, and either investigate this particular issue and/or review any contributions. cheers 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants