-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Error: 'await' is only allowed within async functions and at the top levels of modules. #23687
Comments
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Feb 18, 2025
When we run babel in `-sMODULARIZE` mode the input to babel contains `await` calls. This code appears to be top-level code at the point at which we run babel since we have yet to perform the modularization process which wraps the output in a factory function. Fixes: emscripten-core#23687
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Feb 19, 2025
When we run babel in `-sMODULARIZE` mode the input to babel contains `await` calls. This code appears to be top-level code at the point at which we run babel since we have yet to perform the modularization process which wraps the output in a factory function. Fixes: emscripten-core#23687
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Feb 19, 2025
I really which we had a better solution here, but this makes the use of async/await independent of closure usage. This is a workaround for emscripten-core#23158, but it also happens to fix emscripten-core#23687 which stems from the same issue. Fixes: emscripten-core#23687
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Feb 19, 2025
I really which we had a better solution here, but this makes the use of async/await independent of closure usage. This is a workaround for emscripten-core#23158, but it also happens to fix emscripten-core#23687 which stems from the same issue. Fixes: emscripten-core#23687
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Feb 19, 2025
I really which we had a better solution here, but this makes the use of async/await independent of closure usage. This is a workaround for emscripten-core#23158, but it also happens to fix emscripten-core#23687 which stems from the same issue. Fixes: emscripten-core#23687
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Feb 19, 2025
I really which we had a better solution here, but this makes the use of async/await independent of closure usage. This is a workaround for emscripten-core#23158, but it also happens to fix emscripten-core#23687 which stems from the same issue. Fixes: emscripten-core#23687
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Between version 3.1.74 and 4.0.0 the debug build of JoltPhysics.js broke with error:
I think it's because of this change: #23157
I've created a minimal repro here (just run
./build.sh
to trigger the error):Repro.zip
In JoltPhysics.js you would reproduce it by running
./build.sh Debug
.I can reproduce almost the same error by downloading and building Ammo.js.
It seems to be the combination of
-s MODULARIZE=1
and-s LEGACY_VM_SUPPORT=1
that causes the issue.Version of emscripten/emsdk:
Failing command line in full:
Full link command and output with
-v
appended:The text was updated successfully, but these errors were encountered: