Menci / vite-plugin-top-level-await

Transform code to support top-level await in normal browsers for Vite.
MIT License
273 stars 15 forks source link

Module format "umd" does not support top-level await. Use the "es" or "system" output formats rather. #29

Closed OneSeven closed 1 year ago

OneSeven commented 1 year ago

Doesn't support UMD output?

Menci commented 1 year ago

Vite doesn't support UMD.

OneSeven commented 1 year ago

Vite doesn't support UMD.

Vite can output umd, but it cannot be used with top-level-await. Is there a solution?

ben-xD commented 1 year ago

On discord, a user said (in response to an unrelated issue):

It should work, Vite supports UMD libs. Maybe you could create a small repro and file an issue in the repo, it can be an edge case that was not yet discovered

I get a similar error:

[web-extension:manifest] Module format "iife" does not support top-level await. Use the "es" or "system" output formats rather.

Does it also not support iife? Is there more information to help me debug these errors 🙏

ceynri commented 7 months ago

I found can userollup-plugin-tla to resolve umd format top-level-await support.

dimisus commented 6 months ago

I found can userollup-plugin-tla to resolve umd format top-level-await support.

found this by accident, solved my problem. u sexy