question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

could not load "mediainfo.wasm" in electron renderer

See original GitHub issue
GET //mediainfo.wasm net::ERR_FILE_NOT_FOUND
index.html:1 Uncaught (in promise) TypeError: Failed to fetch
mediainfo.js:874 GET http://mediainfo.wasm/ net::ERR_NAME_NOT_RESOLVED
Uncaught (in promise) TypeError: Failed to fetch

I’m using electron and react. and import mediainfo.js from App.js with this line. import MediaInfo from "mediainfo.js"; I put mediainfo.wasm file into /public directory, but not works.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
buzzcommented, Apr 20, 2020

Thanks for sharing the test repository.

The issue is not related to electron. Your webpack build doesn’t include mediainfo.wasm. If you investigate using the browsers developer tools, you can see that the request for mediainfo.wasm is 200 success, but your app returns some HTML page, not the wasm file. Thus you’re getting the magic word error.

https://mediainfo.js.org/ is a React app bundled with webpack. You can use it as a reference. I also published the code for it. To solve the problem I chose to customize the webpack configuration so that mediainfo.wasm is copied over to the destination folder (using the copy-webpack-plugin).

0reactions
buzzcommented, Apr 21, 2020

The locateFile function is part of the emscripten loader code. I think they tailored it towards being used inside a real browser context. It might be that you need to patch the code in order to make electron find the mediainfo.wasm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vuejs Error while loading mediainfo.js package
I followed same code but i am facing this issue.. The issue is : MediaInfoModule.wasm net::ERR_ABORTED 404 (Not Found) Could not load content ......
Read more >
Unable to load WASM for Electron application? : r/rust
The code I have so far is over here . You should be able to get everything up and running with yarn install...
Read more >
can't resolve 'fs - You.com | The AI Search Engine ...
config.js . Looks like you target is not electron-main or electron-renderer . Open side panel.
Read more >
MediaInfo.NET [Archive] - Doom9's Forum
I think im using it instead of mediainfo now.. Is it possible to make a dark theme? Or maybe possible to let the...
Read more >
Scoop buckets by number of apps - GitHub Pages
Calinou/scoop-games: Scoop bucket for open source/freeware games and ... 87. beerpiss/scoop-bucket: Small tidbits I couldn't find in other Scoop buckets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found