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 fetch setup issue #36

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

msu-copilot
Copy link
Contributor

When I run npm run server, I encountered the error below. I want to fix this by installing a fetch library and have the app to use it.

======
npm run server

[email protected] server
node app.js

/Users/msu/github-app-js-sample/node_modules/@octokit/request/dist-node/index.js:69
throw new Error(
^

Error: 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
at fetchWrapper (/Users/msu/github-app-js-sample/node_modules/@octokit/request/dist-node/index.js:69:11)
at request2 (/Users/msu/github-app-js-sample/node_modules/@octokit/request/dist-node/index.js:192:14)
at hook (/Users/msu/github-app-js-sample/node_modules/@octokit/auth-app/dist-node/index.js:364:24)
at async requestWithGraphqlErrorHandling (/Users/msu/github-app-js-sample/node_modules/@octokit/plugin-retry/dist-node/index.js:71:20)
at async Job.doExecute (/Users/msu/github-app-js-sample/node_modules/bottleneck/light.js:405:18)

======

@msu-copilot msu-copilot requested a review from a team as a code owner February 15, 2024 00:10
Copy link
Contributor

@carturoch carturoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hi @msu-copilot! Thank you so much for taking interest in our GitHub App sample for Javascript!

I wasn't able to reproduce this error when running npm run server, on main, in the following environment:

OS: Ubuntu 20.04.6 LTS
Node: v20.11.0
NPM: 10.2.4

Could you verify that the values on your .env file are accurate?

Because this is a "sample", the errors from having an incorrect path to the private key or an invalid APP_ID, are not very informative 😞. I'd recommend revisiting the setup instructions.

Is there something else that you think I could be missing here, that could result in the error you're seeing?

@msu-copilot msu-copilot force-pushed the issue/fix-fetch-setup-issue branch from bf79c5d to 68ac876 Compare February 19, 2024 01:04
@msu-copilot
Copy link
Contributor Author

Hi @carturoch , thank you for your response. I discovered the issue was due to the outdated Node version I was using. The problem was resolved after I upgraded from v16 to v20. Therefore, in this PR, I've only updated the Node version in the Readme.

Copy link
Contributor

@carturoch carturoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! ✨

@carturoch carturoch merged commit 3877ced into github:main Feb 20, 2024
1 check 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