Hi everyone :)
I have my own application that uses Wasmtime under the hood for running WASM components with custom WIT worlds that the application implements for additional functionality inside the isolate.
I wanted the ability to debug the JS that runs in the isolate so I tried using the StarlingMonkey Debugger extension in vscode with proper configurations in settings.json and launch.json to use my custom binary for running the isolate.
When I try to debug I get the following output:
WASM execution failed
Coredump: error while executing at wasm backtrace:
0: 0xc1f5 - <unknown>!environ_sizes_get
1: 0x21135c - <unknown>!<wasm function 5160>
2: 0x237c61 - <unknown>!<wasm function 5291>
3: 0x1ad4db - <unknown>!<wasm function 4546>
4: 0x89f32f - <unknown>!run
Caused by:
wasm trap: wasm `unreachable` instruction executed
Error: debug-js execution failed
Now this makes sense because from what I understand environ_sizes_get is a P1 function and in my binary I only implement P2 using Wasmtime due to the fact that P1 in Wasmtime doesn't support the component model Linker and only the module Linker.
Is there a way for me to configure StarlingMonkey to use P2 and not P1 for environment variable loading?
I'm using componentize-js to convert my JS into a WASM component so if it is possible further information on integration with componenize-js will also be very helpful :pray:
My end goal is to be able to debug the JS in the isolate using my custom binary, If configuring StarlingMonkey is not the way to achieve this what would be the way?
I didn't find issues that relate to this problem but if there are any I'm happy to contribute to help get this feature implemented if it isn't already.
I managed to fix the error by explicitly importing the wasi:cli/environment world to my own WIT world along with its dependencies.
And now although I can run the WASM component, no breakpoints I add in VS Code are being triggered. Are there any steps I need to do except for what is outlined in the extension's README?
Last updated: Dec 06 2025 at 07:03 UTC