Next.js Discord

Discord Forum

how to off(or on???) CORS in Next js

Unanswered
Yellowhead catfish posted this in #help-forum
Open in Discord
Yellowhead catfishOP
when trying to send a request (I make a request with vanilla JS) to my Next JS application (I only need the status code of the request) it gives an error about the request being blocked by CORS. How can I fix this? My next application uses Clerk, maybe it is somehow interfering

const response = await fetch(MyUrl, {
    method: 'GET',
});

3 Replies

Yellowhead catfishOP
Of course it's possible to put mode: 'no-cors', but then I can't get the status code prompt, which I really need
@Yellowhead catfish solved?