Skip to content

fix(sveltekit): Guard process check when flushing events #15516

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Feb 26, 2025

not sure why but apparently process is not always available in CloudFlare pages, even with compatibility_flags = ["nodejs_compat"] set. This PR adds a guard to the one place where we access process.env in the SvelteKit SDK.

closes #15506

@Lms24 Lms24 requested review from AbhiPrasad and chargome February 26, 2025 16:52
@Lms24 Lms24 self-assigned this Feb 26, 2025
@Lms24 Lms24 merged commit 082e0e8 into develop Feb 26, 2025
36 checks passed
@Lms24 Lms24 deleted the lms/fix-sveltekit-cf-workers branch February 26, 2025 19:59
andreiborza pushed a commit that referenced this pull request Mar 7, 2025
`process` was guarded in
#15516 already, but
it still did not fix the problem as the variable `process` is not even
available so the code still broke. This is another attempt to fix
"process is undefined" reported in
#15506
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: "process is undefined" when using Cloudflare with Sveltekit (9.2.0)
2 participants