Closed SaddamMohsen closed 6 months ago
Looking at your error, this seems to be caused by something else - could you share your whole middleware file?
Looking at your error, this seems to be caused by something else - could you share your whole middleware file?
i think it was caused by this lines of code I used this code to remove the locale from the URL to check if the URL is allowed or not. Therefore, I cannot do this separately for each language. So I removed the locale, checked the access permissions, and then added the locale back. if ((langs.includes(nextUrl.pathname.split('/')[1]))) { // Remove the local segment
//isSegmentRemoved = 1;
nextUrl.pathname = nextUrl.pathname.replace(/^\/(en|ar)\/?/, '');
return NextResponse.rewrite(nextUrl);
}
i don't know how but now it is working but without return
I'll close this issue for now since it's not caused by next-international. Happy to help further if you can share the full middleware code!
i set up everything as the doc and it works perfectly until i connect the frontend with backend using API backend url i get this error
⨯ node_modules\next-international\dist\app\middleware\index.js (78:45) @ get ⨯ Cannot read properties of undefined (reading 'get') Screenshots
About
Additional context I add the next-auth middleware with next-international middleware