You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specifying an invalid locale like locale: "test" the component crashes the whole page:
formatter.js:8 Uncaught (in promise) RangeError: Incorrect locale information provided
at new RelativeTimeFormat (<anonymous>)
at getFormatter (formatter.js:8:23)
at register (state.js:10:23)
at init2 (action.js:8:9)
at relativeTime (action.js:10:5)
at mount (Message.svelte:178:22)
at targetCmp.$$.fragment.m (svelte-hooks.js?v=2364f85d:291:24)
at mount_component (Component.js:44:23)
at Object.mount [as m] (http://localhost:5173/src/routes/(app)/jar/+page.svelte:937:4)
at Object.mount [as m] (http://localhost:5173/src/routes/(app)/jar/+page.svelte:691:21)
The same happens when an invalid date is specified.
Since Svelte has no support for error boundaries, it's very hard to catch these errors in component init. It would be better if this component handled it gracefully with try/catch (for example, printing a console.warn() about the issue) and not display anything if there was an error.
The text was updated successfully, but these errors were encountered:
khromov
changed the title
Invalid locals / date causes fatal
Invalid locale / date causes fatal error
Jul 15, 2023
When specifying an invalid locale like
locale: "test"
the component crashes the whole page:The same happens when an invalid date is specified.
Since Svelte has no support for error boundaries, it's very hard to catch these errors in component init. It would be better if this component handled it gracefully with try/catch (for example, printing a console.warn() about the issue) and not display anything if there was an error.
The text was updated successfully, but these errors were encountered: