Access to fetch at 'http://127.0.0.1:3210/initial_messages' CORS Error when using Local deployments
- Dominant language
- TypeScript
- Stars
- 4.6k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
I'm getting this annoying error while trying to get messages from my **local deployment** of Chef: `Access to fetch at 'http://127.0.0.1:3210/initial_messages' from origin 'http://127.0.0.1:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`. I've setup the correct allowed headers and origins:
```ts
import { httpRouter } from "convex/server";
import { httpAction, type ActionCtx } from "./_generated/server";
import { internal } from "./_generated/api";
import type { Id } from "./_generated/dataModel";
import { ConvexError } from "convex/values";
import { openaiProxy } from "./openaiProxy";
import { corsRouter } from "convex-helpers/server/cors";
import { resendProxy } from "./resendProxy";
const http = httpRouter();
const httpWithCors = corsRouter(http, {
allowedHeaders: ["*"],
allowedOrigins: ["*"],
});
// ...
```
but it still not working.
I'm using Brave Browser and already did the [workaround](https://docs.convex.dev/cli/local-deployments#limitations) and tested in Chrome Browser, but the problem remains.
Any help would be pretty much appreciated.
Contributor guide
Assessment
This issue has not been assessed yet.