Skip to content

Commit 940d60f

Browse files
committed
fix(webapp): stop the dev server sending duplicate CORS headers
In local development, Vite's dev-server CORS middleware reflected the request Origin on every Express response, on top of the app's own CORS handling. The two layers produced a duplicated Access-Control-Allow-Origin header, which browsers reject, breaking cross-origin API calls from a separate frontend in dev. Disabling Vite's dev CORS lets the app be the single source of CORS headers. Dev-only; production is unaffected.
1 parent f26770b commit 940d60f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

apps/webapp/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default defineConfig({
3030
},
3131
},
3232
server: {
33+
cors: false,
3334
warmup: {
3435
clientFiles: ["./app/entry.client.tsx", "./app/root.tsx", "./app/components/**/*.tsx"],
3536
ssrFiles: ["./app/entry.server.tsx", "./app/root.tsx"],

0 commit comments

Comments
 (0)