Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

✅ Stop Next env files leaking into the Playwright test server (#2822)

Luke Vella5d6a9a758bf3
diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts
index d2c6be67f..2ef9d106e 100644
--- a/apps/web/playwright.config.ts
+++ b/apps/web/playwright.config.ts
@@ -25,6 +25,14 @@ export default defineConfig({
command: ci ? `next start --port ${port}` : `next dev --port ${port}`,
url: baseURL,
reuseExistingServer: !ci,
+ env: {
+ // Next layers env files from apps/web (notably the developer's .env) on
+ // top of the process env, leaking dev vars into the test server — e.g.
+ // NEXT_PUBLIC_COOKIE_DOMAIN breaks every authenticated flow. @next/env
+ // skips env file loading entirely when this flag is set, so the server
+ // only sees the .env.test values loaded above.
+ __NEXT_PROCESSED_ENV: "true",
+ },
},
reporter: [
[ci ? "github" : "list"],