Skip to content

Source map stack traces #76

@ehrencrona

Description

@ehrencrona

Stack traces on the client side on the dev server are correctly mapped to the source code, but the server-side stack traces are not

In dev mode, if I throw an exception in Nav.svelte, I get this on the server side:

Error: testing stacktrace
    at eval (/_app/components/Nav.js:15:8)
    at Object.$$render (/web_modules/svelte/internal.js:1343:22)

We should map this back to the Nav.svelte file like happens in Sapper.

On a production build, the client-side stack trace from an error I throw in an on:click looks like this:

Uncaught Error: testing stacktraces
    at HTMLButtonElement.<anonymous> (Nav.js:268)
(anonymous) @ Nav.js:268

The server-side stack traces look like:

Error: testing stacktrace
    at fn (/Users/andreasehrencrona/projects/svelte/kit/examples/hn.svelte.dev/.svelte/build/unoptimized/server/_app/components/Nav.js:13:8)

I suppose we should map these too?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions