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

Unhandled Runtime Error Error: URLs is malformed. #10

Open
loerk opened this issue Apr 15, 2022 · 1 comment · May be fixed by #11
Open

Unhandled Runtime Error Error: URLs is malformed. #10

loerk opened this issue Apr 15, 2022 · 1 comment · May be fixed by #11

Comments

@loerk
Copy link

loerk commented Apr 15, 2022

i ran into this issue in the middleware.ts file. I solved it with changing it into this, just in case someone else has this problem

export default function middleware(req: NextRequest) {
  if (signedinPages.find((p) => p === req.nextUrl.pathname)) {
    const token = req.cookies.TRAX_ACCESS_TOKEN;
    const url = req.nextUrl.clone();
    url.pathname = "/signin";
    if (!token) {
      return NextResponse.redirect(url);
    }
  }
}
@yanndepps
Copy link

thanks a lot @loerk !

@mingdinghan mingdinghan linked a pull request May 6, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants