You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a large import/export file the WASM runtime can panic due to some internal issue happening in rust. This will brick the TS workflow because the promise never returns and the logic of the system will not cleanup properly.
This prevents you from executing future KCL files so you cannot switch files or rerun your code.
Steps to Reproduce
Get the KCL files from here, it is two files one that is a massive export.
Make a massive file to export
Import it into a main.kcl file
Wait for the WASM runtime to brick
Expected Behavior
We should be able to gracefully recover from a crashed WASM/Rust run of the AST.
this.isExecuting and some other cleanup calls need to be invoked to properly restore the TS state in the application after the promise for executeAST dies.
We will be using window.addEventListener('error', (event) => { ... }) to catch a global error since we cannot try catch the error from the executeAST promise it completely dies in that context.
We will need a global error handler that can map some of those runtime errors across the entire application state. It isn't amazing but after pairing with a few devs this is the only thing we could find. When rust panics we cannot catch that error in TS.
Sample error that is being caught with the global handler
The text was updated successfully, but these errors were encountered:
Describe the bug
When you have a large import/export file the WASM runtime can panic due to some internal issue happening in rust. This will brick the TS workflow because the promise never returns and the logic of the system will not cleanup properly.
This prevents you from executing future KCL files so you cannot switch files or rerun your code.
Steps to Reproduce
Get the KCL files from here, it is two files one that is a massive export.
main.kcl
fileExpected Behavior
We should be able to gracefully recover from a crashed WASM/Rust run of the AST.
this.isExecuting
and some other cleanup calls need to be invoked to properly restore the TS state in the application after the promise forexecuteAST
dies.Screenshots and Recordings
Desktop OS
Linux
Browser
No response
Version
v0.34.0
Additional Context
It has at least been a bug since v0.30.0
rustwasm/wasm-bindgen#2392
We will be using
window.addEventListener('error', (event) => { ... })
to catch a global error since we cannot try catch the error from theexecuteAST
promise it completely dies in that context.We will need a global error handler that can map some of those runtime errors across the entire application state. It isn't amazing but after pairing with a few devs this is the only thing we could find. When rust panics we cannot catch that error in TS.
Sample error that is being caught with the global handler
The text was updated successfully, but these errors were encountered: