Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
How can Emscripten load .wasm files stored on AWS S3?

I am trying to display my Emscripten compiled C++/SDL2 app from a React FE.

My .js and .wasm files are being stored on an AWS S3 bucket and fetched from a CloudFront CDN. The .js file gets put on a <script> tag and appended to the page (this works).

The .js file cannot find the .wasm file. Normally this process happens in a method called locateFile() which returns a string path (How can I load .wasm files stored in a subdirectory?). I've overrided this by appending another script with a global Module right before it and attempted to use the cdn:

var Module = {
  locateFile: (function locateFile(path) {
    return `${CDN_WASM_URL}`
  })()
}

However this results in Aborted(CompileError: WebAssembly.instantiate(): expected magic word... found ... which indicates that the returned type may not be correct. I have confirmed the same file works by referencing it locally. However, when running .text() on the Response of fetching both from the CDN and from the local file, the local version appears as random symbols while the result from the CDN shows the actual code of the wasm file.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!