Skip to content

Redirect from beforeLoad: uncaught error #1480

@bazo

Description

@bazo

Describe the bug

when checking if user is authenticated and throwing a redirect from before load an unhandled error is thrown instead of redirect happenning

Your Example Website or App

https://stackblitz.com/edit/github-qtxl7r?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

run the app
open console
try to go to /posts

this error is thrown
router.ts:1607
Uncaught (in promise)
{to: '/login', search: {…}, isRedirect: true, statusCode: 301, headers: {…}, …}

Expected behavior

i am redirected to login page

Screenshots or Videos

No response

Platform

  • OS: mac
  • Browser: edge
  • Version: 122.0.2365.80 (Official build) (arm64)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions