Skip to content

Commit eabc3ab

Browse files
authored
fix: prevent navigation to 500 page during development (#240)
Only navigate to /500 error page in production environment to avoid disrupting developer experience during HMR reloads. Toast notification still shows in both environments for visibility. Fixes #225
1 parent a4733cc commit eabc3ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ const queryClient = new QueryClient({
5959
}
6060
if (error.response?.status === 500) {
6161
toast.error('Internal Server Error!')
62-
router.navigate({ to: '/500' })
62+
// Only navigate to error page in production to avoid disrupting HMR in development
63+
if (import.meta.env.PROD) {
64+
router.navigate({ to: '/500' })
65+
}
6366
}
6467
if (error.response?.status === 403) {
6568
// router.navigate("/forbidden", { replace: true });

0 commit comments

Comments
 (0)