Skip to content

Commit 70825dd

Browse files
fix: define process.env variables in atoms vite config to prevent 'process is undefined' errors (calcom#24665)
- Add all process.env variables used by Next.js code to the define section - This ensures they are replaced at build time and don't cause runtime errors in Vite projects - Fixes calcom#24213 Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 05c399d commit 70825dd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/platform/atoms/vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export default defineConfig(({ mode }) => {
3838
],
3939
define: {
4040
"process.env.NEXT_PUBLIC_WEBAPP_URL": `"${webAppUrl}"`,
41+
"process.env.NODE_ENV": `"${mode}"`,
42+
"process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA": `"${env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA ?? ""}"`,
43+
"process.env.NEXT_PUBLIC_CALCOM_VERSION": `"${env.NEXT_PUBLIC_CALCOM_VERSION ?? ""}"`,
44+
"process.env.__NEXT_ROUTER_BASEPATH": `""`,
45+
"process.env.__NEXT_I18N_SUPPORT": `false`,
46+
"process.env.__NEXT_MANUAL_TRAILING_SLASH": `false`,
47+
"process.env.__NEXT_TRAILING_SLASH": `false`,
48+
"process.env": "{}",
4149
},
4250
ssr: {
4351
noExternal: ["turndown"], // Example if you want to disable SSR for your library

0 commit comments

Comments
 (0)