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]: No "exports" main defined in version 6.0.1 #665

Closed
1 task done
Labels
released Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@marekdedic
Copy link

marekdedic commented Mar 5, 2024

What happened?

I updated @octokit/core to v6.0.1 and now I get the following error. See skaut/poptavky#1373

Versions

@octokit/core v6.0.1

Relevant log output

Error: No "exports" main defined in /home/user/project/node_modules/@octokit/core/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:303:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:593:13)
    at resolveExports (node:internal/modules/cjs/loader:591:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/home/user/project/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.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> (/home/user/project/src/octokit.ts:1:1) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Code of Conduct

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

github-actions bot commented Mar 5, 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

We switched to ESM and you need to use the following options in your tsconfig.json:

"moduleResolution": "node16",
"module": "node16"

@wolfy1339 wolfy1339 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@marekdedic
Copy link
Author

marekdedic commented Mar 5, 2024

Hi, thank you, unfortunately after adding that, the issue still persists. :(

@wolfy1339
Copy link
Member

You need to use ESM, right now your are outputting CJS
https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules

wolfy1339 added a commit that referenced this issue Apr 8, 2024
wolfy1339 added a commit that referenced this issue Apr 9, 2024
* fix(pkg): add a default fallback

See #665 #667

* fix(pkg): add an export for `dist-types/types.d.ts`

Many people are importing from `dist-types/types.d.ts`, and the switch to ESM prevents them from using any of the types defined in that file.

* fix: mark `graphql` import as a type import

* docs: add note on needed config changes for TypeScript
Copy link
Contributor

github-actions bot commented Apr 9, 2024

🎉 This issue has been resolved in version 6.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

wolfy1339 added a commit to octokit/request-error.js that referenced this issue Apr 15, 2024
wolfy1339 added a commit to octokit/endpoint.js that referenced this issue Apr 15, 2024
wolfy1339 added a commit to octokit/plugin-rest-endpoint-methods.js that referenced this issue Apr 16, 2024
wolfy1339 added a commit to octokit/endpoint.js that referenced this issue Apr 16, 2024
* fix(pkg): add a `default` fallback export

See octokit/core.js#665 octokit/core.js#667

* docs(README): add note on needed config changes for TypeScript
wolfy1339 added a commit to octokit/request-error.js that referenced this issue Apr 16, 2024
* fix(pkg): add a default fallback

See octokit/core.js#665 octokit/core.js#667

* docs: add note on needed config changes for TypeScript
wolfy1339 added a commit to octokit/plugin-rest-endpoint-methods.js that referenced this issue Apr 16, 2024
* fix(pkg): add a `default` fallback export

See octokit/core.js#665 octokit/core.js#667

* docs: add note on needed config changes for TypeScript
renovate bot added a commit to JoshuaKGoldberg/create-typescript-app that referenced this issue Apr 26, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@octokit/request-error](https://togithub.com/octokit/request-error.js)
| [`^6.0.0` ->
`^6.1.1`](https://renovatebot.com/diffs/npm/@octokit%2frequest-error/6.0.2/6.1.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@octokit%2frequest-error/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@octokit%2frequest-error/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@octokit%2frequest-error/6.0.2/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@octokit%2frequest-error/6.0.2/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [octokit](https://togithub.com/octokit/octokit.js) | [`3.1.2` ->
`3.2.0`](https://renovatebot.com/diffs/npm/octokit/3.1.2/3.2.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/octokit/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/octokit/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/octokit/3.1.2/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/octokit/3.1.2/3.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>octokit/request-error.js
(@&#8203;octokit/request-error)</summary>

###
[`v6.1.1`](https://togithub.com/octokit/request-error.js/releases/tag/v6.1.1)

[Compare
Source](https://togithub.com/octokit/request-error.js/compare/v6.1.0...v6.1.1)

##### Bug Fixes

- **pkg:** add `default` fallback and `types` export
([#&#8203;419](https://togithub.com/octokit/request-error.js/issues/419))
([a1ab11e](https://togithub.com/octokit/request-error.js/commit/a1ab11e3d9bcc065bb0f5cb1c307d295aef85505)),
closes
[octokit/core.js#665](https://togithub.com/octokit/core.js/issues/665)
[octokit/core.js#667](https://togithub.com/octokit/core.js/issues/667)

###
[`v6.1.0`](https://togithub.com/octokit/request-error.js/releases/tag/v6.1.0)

[Compare
Source](https://togithub.com/octokit/request-error.js/compare/v6.0.3...v6.1.0)

##### Features

- **security:** Add provenance
([#&#8203;416](https://togithub.com/octokit/request-error.js/issues/416))
([2836ddb](https://togithub.com/octokit/request-error.js/commit/2836ddb477c1b9fc0310679017776d0ff8a009c6))

###
[`v6.0.3`](https://togithub.com/octokit/request-error.js/releases/tag/v6.0.3)

[Compare
Source](https://togithub.com/octokit/request-error.js/compare/v6.0.2...v6.0.3)

##### Bug Fixes

- **deps:** update dependency
[@&#8203;octokit/types](https://togithub.com/octokit/types) to v13
([352b655](https://togithub.com/octokit/request-error.js/commit/352b655b176d76c9c03649babaafd063227c3785))

</details>

<details>
<summary>octokit/octokit.js (octokit)</summary>

###
[`v3.2.0`](https://togithub.com/octokit/octokit.js/releases/tag/v3.2.0)

[Compare
Source](https://togithub.com/octokit/octokit.js/compare/v3.1.2...v3.2.0)

##### Features

- **security:** Add provenance
([#&#8203;2653](https://togithub.com/octokit/octokit.js/issues/2653))
([a90799a](https://togithub.com/octokit/octokit.js/commit/a90799a69cb0a62f9103b395c3f26627f0402755))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/JoshuaKGoldberg/create-typescript-app).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment