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

[BUG]: "default" export missing from package.json #541

Closed
1 task done
KyleBoyer opened this issue Apr 23, 2024 · 2 comments · Fixed by #542
Closed
1 task done

[BUG]: "default" export missing from package.json #541

KyleBoyer opened this issue Apr 23, 2024 · 2 comments · Fixed by #542
Labels
released Type: Bug Something isn't working as documented

Comments

@KyleBoyer
Copy link
Contributor

KyleBoyer commented Apr 23, 2024

What happened?

When trying to compile my github action with ncc, an error stated that this plugin (and two others) are missing the "default" export inside package.json -> exports['.']. I believe this is because the scripts/build.mjs has not gotten the latest changes from octokit/core as shown here: https://github.com/octokit/core.js/blob/main/scripts/build.mjs#L63

Versions

  • Node v21.4.0
  • Typescript 5.4.5 (also tried 4.7.4)
  • @vercel/ncc v0.38.1
  • @octokit/plugin-paginate-graphql v5.2.0
  • @octokit/plugin-retry v7.1.0
  • @octokit/plugin-throttling v9.2.0

Relevant log output

> ncc build ./src/action.ts -o dist -d
 
ncc: Version 0.38.1
ncc: Compiling file index.js into CJS
ncc: Using [email protected] (local user-provided)
Error: Module not found: Error: Package path . is not exported from package /Users/kyle/git/actions/octokit_project/node_modules/@octokit/plugin-paginate-graphql (see exports field in /Users/kyle/git/actions/octokit_project/node_modules/@octokit/plugin-paginate-graphql/package.json)
Did you mean './@octokit/plugin-paginate-graphql'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
Module not found: Error: Package path . is not exported from package /Users/kyle/git/actions/octokit_project/node_modules/@octokit/plugin-throttling (see exports field in /Users/kyle/git/actions/octokit_project/node_modules/@octokit/plugin-throttling/package.json)
Did you mean './@octokit/plugin-throttling'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
Module not found: Error: Package path . is not exported from package /Users/kyle/git/actions/octokit_project/node_modules/@octokit/plugin-retry (see exports field in /Users/kyle/git/actions/octokit_project/node_modules/@octokit/plugin-retry/package.json)
Did you mean './@octokit/plugin-retry'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
    at /Users/kyle/git/actions/octokit_project/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:38:1896272
    at /Users/kyle/git/actions/octokit_project/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:38:396262
    at _done (eval at create (/Users/kyle/git/actions/octokit_project/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:21:75523), <anonymous>:9:1)
    at eval (eval at create (/Users/kyle/git/actions/octokit_project/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:21:75523), <anonymous>:34:22)

Related Bugs

octokit/plugin-throttling.js#694
octokit/plugin-paginate-graphql.js#194

Code of Conduct

  • I agree to follow this project's Code of Conduct
@KyleBoyer KyleBoyer added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Apr 23, 2024
Copy link

👋 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 Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

Copy link

🎉 This issue has been resolved in version 7.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants