Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

274
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda