Help. 502 ROUTER CANNOT MATCH error occured
Unanswered
English Spot posted this in #help-forum
English SpotOP
First of all, Sorry for my weak english.
When I deploy my project on vercel, this issue occurring.
There was no problem on local environment.
in build result, below pages are generated as SSG.
/emergency-card/Basic
├ ├ /emergency-card/MedicalConditions
├ ├ /emergency-card/Medication
...
https://pre-ver.easy-doc.app/emergency-card/Basic
when I access this page, this error occured. how can I solve it?
nextjs version : 13.4.1
When I deploy my project on vercel, this issue occurring.
There was no problem on local environment.
in build result, below pages are generated as SSG.
/emergency-card/Basic
├ ├ /emergency-card/MedicalConditions
├ ├ /emergency-card/Medication
...
https://pre-ver.easy-doc.app/emergency-card/Basic
when I access this page, this error occured. how can I solve it?
nextjs version : 13.4.1
11 Replies
@English Spot First of all, Sorry for my weak english.
When I deploy my project on vercel, this issue occurring.
There was no problem on local environment.
in build result, below pages are generated as SSG.
/emergency-card/Basic
├ ├ /emergency-card/MedicalConditions
├ ├ /emergency-card/Medication
...
https://pre-ver.easy-doc.app/emergency-card/Basic
when I access this page, this error occured. how can I solve it?
nextjs version : 13.4.1
https://github.com/vercel/next.js/discussions/48168#discussioncomment-6973508
someone reported this issue still exists with v13.4.19
are you able to upgrade the version?
someone reported this issue still exists with v13.4.19
are you able to upgrade the version?
English SpotOP
ohno Version upgrading makes compile error.
what error?
English SpotOP
There was a package issue, but it was resolved right away. Let me check deploy result.
no version update doesnt work
updated to 14.0.4
next build & next start work in locally?English SpotOP
Yes vercel environment only occured.
Buy the way I found solution. middleware.ts behind us...
const middleware = (request: NextRequest) => {
const isMaintenance: boolean = process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true';
if (isMaintenance) {
return NextResponse.redirect(new URL('/maintenance/', request.url));
} else {
// return NextResponse.next();
}
};
export const config = {
matcher: '/((?!img|maintenance)):path*',
};
export default middleware;
I don't know why upper code makes this issue.
const isMaintenance: boolean = process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true';
if (isMaintenance) {
return NextResponse.redirect(new URL('/maintenance/', request.url));
} else {
// return NextResponse.next();
}
};
export const config = {
matcher: '/((?!img|maintenance)):path*',
};
export default middleware;
I don't know why upper code makes this issue.
@Ray Thanks reply!