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

Web target now requires async support #2034

Closed
nickbabcock opened this issue Mar 5, 2020 · 1 comment
Closed

Web target now requires async support #2034

nickbabcock opened this issue Mar 5, 2020 · 1 comment
Labels

Comments

@nickbabcock
Copy link
Contributor

nickbabcock commented Mar 5, 2020

I have a project (can link if desired) which executes:

wasm-pack build --target web 

and the resulting js is interpreted by parcel. #1996 introduced async/await into the generated js. My project doesn't use async/await so this was the first instance of said feature. By default, parcel is unable to cope with async without additional configuration. The result is the js error "Error: regeneratorRuntime is not defined" at runtime.

I'm fine with this change in behavior (introducing async) if is it's intended, but just wanted to voice something I stumbled upon. Perhaps a note in the changelog highlighting this change is called for?

@alexcrichton
Copy link
Contributor

Thanks for the report! The glue generated by wasm-bindgen is intended to be run in relatively modern environments, though, and I think that every browser which supports wasm should support async.

For bundlers it's recommended to use --target bundler, but unfortunately I'm not sure that parcel has enough wasm support implemented to support --target bundler just yet.

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

No branches or pull requests

2 participants