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

Throw a helpful error when fetch is not set #2497

Closed
3 tasks done
oscard0m opened this issue Jul 15, 2023 · 1 comment
Closed
3 tasks done

Throw a helpful error when fetch is not set #2497

oscard0m opened this issue Jul 15, 2023 · 1 comment
Assignees

Comments

@oscard0m
Copy link
Member

oscard0m commented Jul 15, 2023


Maybe we could add a section to the README and link to it from the error, so we can provide a more thorough explanation and most importantly we can update whenever needed.

I'd say the availability of fetch is independent of the Node version. fetch is still experimental and it can be disabled with --no-experiemental-fetch. Also Node is not the only place where Octokit is run, I'm not sure if e.g. Electron or React Native have a global fetch method.

I'd do something like this:

fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing

Originally posted by @gr2m in #2486 (comment)

@gr2m

This comment was marked as resolved.

@oscard0m oscard0m changed the title Be more explicit that this package (and other Octokit packages) does not support Node 14/16 Throw a helpful error when fetch is not set Jul 15, 2023
@oscard0m oscard0m changed the title Throw a helpful error when fetch is not set Throw a helpful error when fetch is not set Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants