Closed mymmrac closed 2 months ago
TinyGo does not include this information, to reduce binary file size. If you want stack traces, the VM needs to support them. Apparently the browser you're using doesn't. But wasmtime
does, if you set the WASMTIME_BACKTRACE_DETAILS=1
environment variable.
So TinyGo uses something different then Go for panic stack trace? Because in both cases I used Firefox and Go wasm binary printed full stack trace
@mymmrac Yes. TinyGo and Go handle panics and stack traces differently.
Got it, many thanks for the information and quick reply
Just in case someone encounters similar issues, using Chrome you can get a kind of stack trace, but it will link to wasm code (in WAT format), but still it can help identify the issue
TinyGo v0.32.0
Simple example:
When compiled with regular Go (
GOOS=js GOARCH=wasm
) and run in browser console looks like this:But when compiled with TinyGo (
-target wasm
) it looks like this:How to get full stack trace of panic when using TinyGo?