buzz / mediainfo.js

Extract media file metadata in the browser using WebAssembly.
https://mediainfo.js.org
BSD 2-Clause "Simplified" License
712 stars 108 forks source link

Cannot use with Vite #120

Closed rstoenescu closed 1 year ago

rstoenescu commented 1 year ago

Issue Summary

​ The file dist/mediainfo.js contains =await import('module') which breaks the usage with Vite, since what Vite does is a lookup for any import statements.

This was introduced in MediaInfo v0.1.9

Steps to Reproduce

I will provide a reproduction repo if actually necessary. Apologies for not doing so from the very beginning, but I think that the issue description says it all. If the import statement is transformed to a regular require() it will 100% solve the problem.

Please tell me if you still need the reproduction repo or if I should supply any other additional information.

Thank you for your work on this package!

NormandoHall commented 1 year ago

Same here #118

NormandoHall commented 1 year ago

Good catch @rstoenescu !!! Meanwhile this is fixed, I was downgrade to 0.1.8 and runs perfect with Sveltekit (Vite)

NormandoHall commented 1 year ago

Well... after a few tests, installed as dependencies (no devDependencies) seems fix the issue, also for 0.1.9, in my case using Sveltekit.

buzz commented 1 year ago

Hope this is fixed for you. In any case, there's also an example on how to setup tooling for Vite.