Typescript for error on fallback function? #12571
-
I use Typescript in my project and just updated from v7 to v8. I see that the FallbackRender type now has |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@louispotok this is intentional because anything can be used with a I think you should use |
Beta Was this translation helpful? Give feedback.
@louispotok this is intentional because anything can be used with a
throw
statement. See: https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#updated-error-types-to-be-unknown-instead-of-errorI think you should use
typeof Error
checks to enforce that the thrown variable is an error.