CORS is causing hell in App Router #64115
Unanswered
udohjeremiah
asked this question in
App Router
Replies: 4 comments
-
Running into the same issue here.. any updates please? |
Beta Was this translation helpful? Give feedback.
0 replies
-
tried exactly the same options and getting crs error each time as well, did you manage to find a solution? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Getting same error, very frustrating |
Beta Was this translation helpful? Give feedback.
0 replies
-
for the options request there can you be more specific about the endpoint that you wanna allow that worked for me by allowing like this - export async function OPTIONS(request: Request) {
return NextResponse.json(
{},
{
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST",
"Access-Control-Allow-Headers": "Content-Type, Authorization",
},
},
);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm saying this with pain, because having gone through all the outlined methods to solving CORS issue when using Next.js App Router, painfully none has worked.
I am making a simple
POST
request fromhttp:localhost:3001
tohttp://localhost:3000/example
. But I keep getting these errors:This is my request:
This is my api
route.ts
:This is my version:
The methods I've tried to no avail are listed below:
next.config.js file
:Beta Was this translation helpful? Give feedback.
All reactions