Skip to content

Commit

Permalink
Vercel middleware bug (lukevella#293)
Browse files Browse the repository at this point in the history
* Remove rewrite

* Revert change to middleware
  • Loading branch information
lukevella authored Aug 18, 2022
1 parent c51514d commit 9940be1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
4 changes: 0 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ const moduleExports = {
source: "/",
destination: "/home",
},
{
source: "/:urlId",
destination: "/poll?urlId=:urlId",
},
{
source: "/p/:urlId",
destination: "/poll?urlId=:urlId",
Expand Down
6 changes: 1 addition & 5 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ export function middleware({ headers, cookies, nextUrl }: NextRequest) {
}
}

// TODO (Luke Vella) [2022-08-18]: There seems to be a bug on vercel that
// results in the component being remounted when doing NextResponse.next() rather
// than loading the correct component.
// return NextResponse.next();
return NextResponse.rewrite(newUrl);
return NextResponse.next();
}

export const config = {
Expand Down

0 comments on commit 9940be1

Please sign in to comment.