CompileError using webpack: Missing mediainfo.wasmSee original GitHub issue
It seems like there is a bug. Here is what I’m getting when playing around with the library using create react app template:
Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -s ASSERTIONS=1 for more info. at abort (http://localhost:3000/static/js/1.chunk.js:3145:17) at http://localhost:3000/static/js/1.chunk.js:3239:15
That’s how the lib is being imported:
import MediaInfo from 'mediainfo.js'
Any suggestions? Thanks!
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
The WASM loader tries to load
mediainfo.wasm. It determines the URL relative to
When using a CDN this just works because
mediainfo.wasm is published in the
When you’re using a custom bundler build flow you need to make sure to copy
mediainfo.wasm to your output directory. Check the source code of https://mediainfo.js.org/ on how this is achieved using webpack and
Docs on using a JS bundler could be improved, I guess.
I made it work loading from the CDN! thanks