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

Catching runtime warnings in production #14321

Open
WaltzingPenguin opened this issue Nov 16, 2024 · 2 comments
Open

Catching runtime warnings in production #14321

WaltzingPenguin opened this issue Nov 16, 2024 · 2 comments

Comments

@WaltzingPenguin
Copy link

Describe the problem

Svelte 5 introduced a fair number of warning that may be issued at runtime: binding_property_non_reactive, state_proxy_equality_mismatch, etc.. These are "warnings" in that the window doesn't crash, but they all indicate real errors and the application will not work as expected. There's currently no good way to capture these errors and send them to Sentry/Bugsnag/etc.

Describe the proposed solution

I would like to see either:

  • A compiler option to upgrade all warnings to errors
  • Some sort of hook/callback to be able to add additional custom behaviour

Importance

nice to have

@webJose
Copy link
Contributor

webJose commented Nov 16, 2024

In my mind, the ideal solution is for Svelte to always log to an ILogger object. Consumers of the library could call a setLogger() function with their implementation of the ILogger they want/need, and if none is set, the default ILogger would simply log to the console.

@paoloricciuti
Copy link
Member

Currently warnings are only issued in dev mode if I'm not mistaken but I guess we could have some sort of option to allow them in prod too (and eventually we would log to some logger)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants