-
Notifications
You must be signed in to change notification settings - Fork 13
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
[BUG]: Error being thrown when trying to authenticate with v8.0.2 #428
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
Are you using ESM in your code? |
Yes I am, my bad for not mentioning it in the original post |
I can't reproduce it myself |
Can you try modifying the "module": "./dist-node/index.js",
"types": "./dist-types/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist-types/index.d.ts",
"default": "./dist-node/index.js"
}
}
}, |
We tried reproducing it with a simple JS script and were able to do so as well. It was essentially this:
|
You are using the wrong kind of import there, that's a CJS import https://blog.logrocket.com/commonjs-vs-es-modules-node-js/ import { createOAuthAppAuth } from "@octokit/auth-oauth-app"; |
What happened?
What did I do:
I'm trying to import and use
@octokit/auth-oauth-app
to handle Github user authentication in an AWS Lambda function.What happened:
I was able to trigger the lambda function but got the following error message:
No \"exports\" main defined in /var/task/node_modules/@octokit/auth-oauth-app/package.json
What did I expect:
I was expecting to be able to trigger the lambda, successfully authenticate and perform other actions using the access_token I'd have received from the authentication.
Versions
Octokit version: 8.0.2
Node version: 18.17
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: