Skip to content

Vite cannot parse error messages thrown during SSR #17730

@jansedlon

Description

@jansedlon

What version of Bun is running?

1.2.4+fd9a5ea66

What platform is your computer?

Darwin 24.3.0 arm64 arm

What steps can reproduce the bug?

I'm not really sure. I think that making a react router application and then intentionally writing invalid code to throw an error should do it.

What is the expected behavior?

I should be able to see the error that was thrown was anytime this happens, i just see

Internal server error: undefined is not an object (evaluating 'varName.trim').

What do you see instead?

It doesn't matter if the error originates from drizzle-orm or something on the frontend.

It always happens in function called ssrRewriteStacktrace which is implemented by vite.

Image

In this particular example if I run it with Node, you can see that i was trying to call a function that was not defined.

Image

Additional information

I have been seeing this issue for many months now and it's kind of a blocker for me. Seeing issues like this are the reason why i'm hesitant to migrate to bun.

It makes it really hard to develop something in Bun if i cannot debug what happened 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions