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]: Need to update to ESM for compat with @octokit/core@6 #173

Closed
1 task done
jyasskin opened this issue Mar 4, 2024 · 2 comments · Fixed by #175
Closed
1 task done

[BUG]: Need to update to ESM for compat with @octokit/core@6 #173

jyasskin opened this issue Mar 4, 2024 · 2 comments · Fixed by #175
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@jyasskin
Copy link

jyasskin commented Mar 4, 2024

What happened?

Tested speced/spec-maintenance#20 locally, which updates @octokit/core from 5.1.0 to 6.0.1. This fails with Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in .../@octokit/core/package.json. I believe that's because https://github.com/octokit/plugin-paginate-graphql.js/blob/main/scripts/build.mjs hasn't gotten an update equivalent to octokit/core.js@77f8a61#diff-d3831cd61824ee8713cea7361c0fe4cb921f80deb8eaec5ebccc434be0e96d6e.

Versions

Octokit.js 6.0.1, plugin-paginate-graphql.js 4.0.0, Node.js 20.10.0, pnpm 8.15.1

Relevant log output

node:internal/modules/esm/resolve:294
  return new ERR_PACKAGE_PATH_NOT_EXPORTED(
         ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in .../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@octokit/core/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:294:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:584:13)
    at resolveExports (node:internal/modules/cjs/loader:591:36)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (.../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@octokit/plugin-paginate-graphql/dist-node/index.js:26:20)
    at Module._compile (node:internal/modules/cjs/loader:1376:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v20.10.0

Code of Conduct

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

github-actions bot commented Mar 4, 2024

👋 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! 🚀

@wolfy1339
Copy link
Member

wolfy1339 commented Mar 4, 2024

You can use this plugin with @octokit/core@6, you just need to change the way you import it since it's importing CJS from ESM. Nevermind that, it's imported in the package, though it's not used at runtime it's only for the types

The required changes are coming for this package soon

@wolfy1339 wolfy1339 linked a pull request Mar 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants