Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack traces in default client-side error behaviour #692

Open
mattosborn opened this issue Jan 27, 2023 · 0 comments
Open

Stack traces in default client-side error behaviour #692

mattosborn opened this issue Jan 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mattosborn
Copy link

The default unhandled client-side error behaviour is to render the error as HTML and log it to console.

The rendered error shows the original stack trace, whereas the logged error shows the source-mapped stack trace (console.error handles the mapping).

Is this the intended behaviour at present?

Simplest workaround I've found is to drop source-map-support into your project to handle this mapping implicitly. Adding this to <Head> works, and should map traces before they are rendered to HTML:

<script src="/node_modules/source-map-support/browser-source-map-support.js" />
<script>sourceMapSupport.install()</script>

It would be great if solid-start could handle this mapping by default in dev mode. I'm not sure of the best cross-engine approach to making this happen. It doesn't look like V8 makes this easy, and I don't know about other engines, which I guess is why libs exist for this. Loading a lib like source-map-support would be a simple solution but I'm not sure what the trade-offs are here.

@mattosborn mattosborn changed the title Default client-side error behaviour / stack traces Stack traces in default client-side error behaviour Jan 27, 2023
@ryansolid ryansolid added the enhancement New feature or request label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants