-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating Javascript code leads to not being able to find/load binary #22910
Comments
Just to to clear are the errors you are reporting here coming from or related to webpack? Is that what If possible you could try bisecting to see which version of emscripten broke your build: https://emscripten.org/docs/contributing/developers_guide.html#bisecting |
Yes, the project was bootstrapped with Create React App, which relies on Webpack. The point is trying to figure out why old versions can be loaded/instantiated with a simple setup, but not the new ones. I'll try other approaches based on #13074 and let you know if anything works. |
So the error you are seeing is happening at webpack time? Not at runtime right? I think the key figuring out what is broken is going to be figuring out which change caused the breakage, so I possible it would be great to bisect to figure out which change it was. We can and should also look into adding tests to emscripten that use webpack in the way that you are doing to ensure we don't break this setup again going forward. But first we need to figure out what it is that webpack doens't like about the current emscripten output. |
Oh wait.. looking at the error lines it looks like webpack doesn't like the |
@netolcc06 If the issue is |
That was the issue. Good point. I just replaced the expressions with the |
I imagine you should be able to tell webpack to accept modern stuff like |
If you want to use a dynamic path to your wasm file you might want to look at overriding the |
Hello guys,
Recently I managed to get a working version of cvc5 compiled with Emscripten 3.1.70. After that, I started a new saga, which is updating the application cvc5_web to use a modularized version of cvc5 - it uses Emscripten 3.1.18 since forever.
I used the flags:
-s EXPORTED_RUNTIME_METHODS='["ccall","cwrap"]' -s ENVIRONMENT=web -s EXPORTED_FUNCTIONS=_main -s INVOKE_RUN=1 -s EXIT_RUNTIME=0 -s INCOMING_MODULE_JS_API=arguments,canvas,monitorRunDependencies,print,setStatus -sALLOW_MEMORY_GROWTH -sASSERTIONS -sNO_DISABLE_EXCEPTION_CATCHING -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0 -s MODULARIZE
The point here would be having new
wasm
andcvc5.js
files to keep the tool working. Spoiler: it didn't work. It feels like the issue I'm having is related to the one described here: #13074One interesting thing about the solution proposed by @donalffons is that previously I didn't need to do any of this to have cvc5_web running properly, but somehow my current configs do not work with the new binary and glue code.
Old binary + old glue code => page works
New Binary with old modularized glue code
Unhandled Rejection (RuntimeError): Aborted(TypeError: WebAssembly.instantiate(): Import #0 "env": module is not an object or function)
I wouldn't expect this to work ofc, but it is interesting that the binary can be found, but not instantiated. I can also see that scriptDir is set as http://localhost:8080/cvc5_web/ and
wasmBinaryFile as http://localhost:8080/cvc5_web/cvc5.wasm
If I try the new files, it simply can't find / instantiate the wasm file.
I also tried a few suggestions from https://stackoverflow.com/questions/63423384/you-may-need-an-additional-loader-to-handle-the-result-of-these-loaders, but with no success.
Fundamentally, why can't the new glue code find the binaries, if the old one could? What exactly cannot be handled by these loaders after I pass the hardcoded path to my binary?
As you might have noticed, I'm not experienced with Javascript and all related environments.
The text was updated successfully, but these errors were encountered: