-
Notifications
You must be signed in to change notification settings - Fork 13
CORS Error #17
Copy link
Copy link
Open
Description
After following the guide, I was getting CORS errors. From the network tab debugger, I saw a 404 error on the OPTIONS endpoint.
Workaround
I had to add the option route and set the CORS header to get past the error.
Local Environment; Not tried in production
Browser: Firefox 148.0.2 (aarch64)
Convex: ^1.32.0
"@convex-dev/persistent-text-streaming": "^0.3.0",
http.route({
path: '/workflow-stream',
method: 'POST',
handler: streamWorkflowContent,
});
http.route({
path: '/workflow-stream',
method: 'OPTIONS',
handler: httpAction(async (_ctx, _request) => {
return await new Promise((resolve) => {
resolve(
new Response(null, {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
},
}),
);
});
}),
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels