Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: sever env detection for deno #4064

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

elrrrrrrr
Copy link
Contributor

@elrrrrrrr elrrrrrrr commented Jan 9, 2025

In the new version of swr (2.3.0), globalThis is used to determine if the environment is Deno. (#2915)

This will cause errors in lower version browser environments (android <=13) (ios <12) where globalThis does not exist.

Since swr is a widely used request library, we hope to ensure compatibility as much as possible.

In Deno 2, window has been removed, as discussed in this issue: denoland/deno#13367

I have added a new method isLegacyDeno for this check. 🙏🏻

Copy link

codesandbox-ci bot commented Jan 9, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@huozhi huozhi changed the title fix: globalThis fix: sever env detection for deno Jan 10, 2025
@huozhi huozhi merged commit f521fb7 into vercel:main Jan 10, 2025
7 checks passed
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.

2 participants