Skip to content

fix: handle empty publicStripeKey to prevent frontend crash (#5640)#5641

Open
iroussos25 wants to merge 1 commit intoNangoHQ:masterfrom
iroussos25:master
Open

fix: handle empty publicStripeKey to prevent frontend crash (#5640)#5641
iroussos25 wants to merge 1 commit intoNangoHQ:masterfrom
iroussos25:master

Conversation

@iroussos25
Copy link

@iroussos25 iroussos25 commented Mar 15, 2026

Description:
Noticed the crash report in #5640 and wanted to help get this resolved for self-hosted users.

The Fix:
On systems where operational reliability is key, "empty" strings can be more dangerous than "missing" ones. I've updated the environment handling to sanitize empty strings to undefined and added a guardrail in the frontend to prevent the Stripe SDK from initializing (and crashing) without a valid key.

Changes:

Updated WindowEnv interface to allow publicStripeKey to be undefined.

Modified getEnvJs to sanitize empty environment strings to undefined.

Updated stripe.ts to conditionally load the SDK only when a valid key is present.

Closes #5640.

P.S. I recently applied for the Software Engineering role at Nango (Name: Giannis Roussos) . While going through the docs and setting things up, I ran into this issue and figured the best way to introduce myself was with a fix. Looking forward to potentially building more with the team.


This PR also includes a pnpm lockfile update alongside the Stripe-related environment handling changes.


This summary was automatically generated by @propel-code-bot

Copy link
Contributor

@propel-code-bot propel-code-bot 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; changes appear safe and align with stated goals.

Status: No Issues Found | Risk: Low

Review Details

📁 4 files reviewed | 💬 0 comments

Instruction Files
├── .claude/
│   ├── agents/
│   │   └── nango-docs-migrator.md
│   └── skills/
│       ├── agent-builder-skill/
│       │   ├── EXAMPLES.md
│       │   └── SKILL.md
│       ├── creating-integration-docs/
│       │   └── SKILL.md
│       └── creating-skills-skill/
│           └── SKILL.md
├── AGENTS.md
└── GEMINI.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

publicStripeKey: "" crash in env.js for self-hosted instances.

1 participant