Skip to content

Conversation

@krichprollsch
Copy link
Member

@krichprollsch krichprollsch commented May 16, 2025

@krichprollsch krichprollsch self-assigned this May 16, 2025
@krichprollsch
Copy link
Member Author

info(page): GET http://127.0.0.1:1234/error.html 200
info(console): in
info(page): eval module inline: TypeError: Cannot read properties of undefined (reading 'foo')
warning(page): evaljs: error.JsErr
<!DOCTYPE html>
<html><head></head><body>
    <script type="module">
        console.log("in");
        const a = undefined;
        let b = a.foo;
        console.log("out");
    </script>

</body></html>

Having the stack trace seems more challenging 🤔
It works differently than the try catch.

scope: *const Scope,

// the caller needs to deinit the string returned
pub fn exception(self: Exception, allocator: Allocator) !?[]const u8 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this can actually return null.

@karlseguin
Copy link
Collaborator

FWIW, I spent at least an hour yesterday trying to figure out why DDG scripts were silently failing/aborting. I figured they had some global try/catch, or a window.onerror hook or something else that prevent the error from bubbling out.

I tried this branch, and I'm seeing an eval module now, so that should help.

@krichprollsch krichprollsch merged commit a3b576a into main May 17, 2025
9 checks passed
@krichprollsch krichprollsch deleted the module-exception branch May 17, 2025 09:17
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

module execution fails silently

3 participants