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: fallback to "<environment unknown>" if navigator is undefined #41

Merged
merged 3 commits into from
Feb 21, 2020

Conversation

olivernybroe
Copy link
Contributor

When using CloudFlare workers, the navigator is not available.

The navigator is not even set to undefined, so we check for the exception instead, to make sure we always handle if it fails getting the user agent.

fixes: octokit/graphql.js#78

When using CloudFlare workers, the navigator is not available.

The
navigator is not even set to `undefined`, so we check for the exception
instead, to make sure we always handle if it fails getting the user
agent.
src/browser.ts Outdated Show resolved Hide resolved
olivernybroe and others added 2 commits February 21, 2020 19:37
Co-Authored-By: Gregor Martynus <gregor@martynus.net>
…s browser-specific

the code will run in all kind of JS runtime environments
@gr2m gr2m changed the title feat(CloudFlare-worker): Add support for CloudFlare workers fix: fallback to "<environment unknown>" if navigator is undefined Feb 21, 2020
@gr2m gr2m merged commit d45e9dd into gr2m:master Feb 21, 2020
@gr2m
Copy link
Owner

gr2m commented Feb 21, 2020

Thanks Oliver!

@gr2m
Copy link
Owner

gr2m commented Feb 21, 2020

🎉 This PR is included in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gr2m gr2m added the released label Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't load client in Cloudflare workers
2 participants