Skip to content

WebAssembly won't initialize without the debugger #1558

@m-abs

Description

@m-abs

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.3.0
  • Cross-platform modules: 6.3.1
  • Android Runtime: 6.3.0
  • iOS Runtime (if applicable): Not Applicable
  • Plugin(s): None

Devices:

  • Oneplus 7T Pro McLaren - Android 10
  • Emulator - Android 9/SDK 29.

Describe the bug

I'm not sure why, but I can't get the promise from WebAssembly.compile(...) or WebAssembly.instantiate(...) to resolve without connecting the chrome debugger to my app and stepping through JavaScript.

What makes this really odd, is that it doesn't matter what JS-code I step through.

To Reproduce

  1. Start the app normally with tns run android
  2. Attempt to initialize the WASM code.
  3. The promise is never resolved or rejected.

But it will resolve if I use the chrome debugger:
Steps to load with the debugger.

  1. Start the app with tns debug android
  2. Attempt to initialize the WASM code.
  3. Connect the chrome-debugger via devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:40000
  4. Enter and run this code
(function() { debugger; })();
  1. Step to next line a few time and let it continue.
  2. If the promise wasn't resolved, press arrow-up to go back in the console.

Expected behavior
The promise from WebAssembly.compile(...) or WebAssembly.instantiate(...) to either resolve or reject without the debugger.

Sample project

Demo project here: https://github.com/m-abs/tns-wasm
WASM code is a very simple "Hello World" program.

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions