fix: make next environment variables optional, externalize react runtime#24613
Merged
anikdhabal merged 5 commits intocalcom:mainfrom Oct 27, 2025
Merged
fix: make next environment variables optional, externalize react runtime#24613anikdhabal merged 5 commits intocalcom:mainfrom
anikdhabal merged 5 commits intocalcom:mainfrom
Conversation
|
@JacobNWolf is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
ThyMinimalDev
previously approved these changes
Oct 24, 2025
Contributor
E2E results are ready! |
Contributor
|
@JacobNWolf can you pls fix the conflicts? Also conflicts after merging this pr:- #24665 |
Ryukemeister
approved these changes
Oct 27, 2025
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes two issues #22661 and #16656 for the
@calcom/atomspackage by defining theNEXT_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):

After (Functional):

Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
We built the beehiiv app using the released package
@calcom/atomsand received a white screen of death. After forking and applying the Vite fixes, we used the forked version@jacobwolf/calcom-atomsand 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 viteand choosing thereactorreact-tsvariants), then install the@calcom/atomspackage after importing it into your project. Then build and attempt to run via the outputtedindex.htmlfile — it should white screen of death due to no access toprocess.envand a mismatch between React 18 and 19 APIs.Then, swap the
@calcom/atomspackage for@jacobwolf/calcom-atomsand try the same steps. It should not white screen of death and should run as expected.