Skip to content

fix: make next environment variables optional, externalize react runtime#24613

Merged
anikdhabal merged 5 commits intocalcom:mainfrom
JacobNWolf:main
Oct 27, 2025
Merged

fix: make next environment variables optional, externalize react runtime#24613
anikdhabal merged 5 commits intocalcom:mainfrom
JacobNWolf:main

Conversation

@JacobNWolf
Copy link
Contributor

@JacobNWolf JacobNWolf commented Oct 22, 2025

What does this PR do?

Fixes two issues #22661 and #16656 for the @calcom/atoms package by defining the NEXT_ specific variables at build time, rather than required at runtime.

This allows for use in non-Next.js environments, such as fully bundled, client only React apps such as beehiiv. This also lets the consumer of the package be responsible for providing the relevant React API, allowing for use with React 19, which deprecated the API that is being called in #16656.

Visual Demo

Image Demo:

Before (White Screen of Death):
image

After (Functional):
image

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox. — N/A.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

We built the beehiiv app using the released package @calcom/atoms and received a white screen of death. After forking and applying the Vite fixes, we used the forked version @jacobwolf/calcom-atoms and it worked. No more white screen of death from either the environment variable issues, nor the React incompatibility.

To test, start a React 19 project using Vite (using a command such as pnpm create vite and choosing the react or react-ts variants), then install the @calcom/atoms package after importing it into your project. Then build and attempt to run via the outputted index.html file — it should white screen of death due to no access to process.env and a mismatch between React 18 and 19 APIs.

Then, swap the @calcom/atoms package for @jacobwolf/calcom-atoms and try the same steps. It should not white screen of death and should run as expected.

@JacobNWolf JacobNWolf requested a review from a team October 22, 2025 03:06
@JacobNWolf JacobNWolf requested a review from a team as a code owner October 22, 2025 03:06
@vercel
Copy link

vercel bot commented Oct 22, 2025

@JacobNWolf is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Oct 22, 2025
@graphite-app graphite-app bot requested a review from a team October 22, 2025 03:06
@CLAassistant
Copy link

CLAassistant commented Oct 22, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

ThyMinimalDev
ThyMinimalDev previously approved these changes Oct 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2025

E2E results are ready!

@anikdhabal
Copy link
Contributor

@JacobNWolf can you pls fix the conflicts? Also conflicts after merging this pr:- #24665

@vercel
Copy link

vercel bot commented Oct 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Oct 27, 2025 0:29am
cal-eu Ignored Ignored Oct 27, 2025 0:29am
calcom-web-canary Ignored Ignored Oct 27, 2025 0:29am

@anikdhabal anikdhabal merged commit 81d9d84 into calcom:main Oct 27, 2025
30 of 35 checks passed
@Ryukemeister Ryukemeister mentioned this pull request Jan 17, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Created by Linear-GitHub Sync ready-for-e2e size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants