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 #694

Closed
1 task done
KyleBoyer opened this issue Apr 23, 2024 · 1 comment · Fixed by #695
Closed
1 task done

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

KyleBoyer opened this issue Apr 23, 2024 · 1 comment · Fixed by #695
Labels

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-retry.js#541
octokit/plugin-paginate-graphql.js#194

Code of Conduct

  • I agree to follow this project's Code of Conduct
Copy link
Contributor

🎉 This issue has been resolved in version 9.2.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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant