Skip to content

fix: sever env detection for deno#4064

Merged
huozhi merged 1 commit intovercel:mainfrom
elrrrrrrr:fix-gloablThis
Jan 10, 2025
Merged

fix: sever env detection for deno#4064
huozhi merged 1 commit intovercel:mainfrom
elrrrrrrr:fix-gloablThis

Conversation

@elrrrrrrr
Copy link
Copy Markdown
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. 🙏🏻

@codesandbox-ci
Copy link
Copy Markdown

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
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