octokit.js: [BUG]: types don't resolve for `@octokit/core` on esm.sh
What happened?
deno check ... consistently errors when using octokit via esm.sh
Versions
Octokit.js v4.0.2 Deno v2.0.6
Relevant log output
$ deno check *.ts **/*.ts --allow-import
error: Failed resolving types. Relative import path "@octokit/core/types" not prefixed with / or ./ or ../ and not in import map from "https://esm.sh/v135/octokit@4.0.2/X-ZS8q/dist-types/octokit.d.ts"
at https://esm.sh/v135/octokit@4.0.2/X-ZS8q/dist-types/octokit.d.ts:4:59
$
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (10 by maintainers)
Commits related to this issue
- fix: remove `@types/node` from generated types See https://github.com/octokit/octokit.js/issues/2762#issuecomment-2486997620 — committed to octokit/types.ts by wolfy1339 2 years ago
- fix: remove `@types/node` from generated types (#656) See https://github.com/octokit/octokit.js/issues/2762#issuecomment-2486997620 — committed to octokit/types.ts by wolfy1339 2 years ago
- ⬆️ Update dependency @octokit/types to v13.6.2 (#462) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@octokit/types... — committed to WtfJoke/setup-tectonic by renovate[bot] 2 years ago
- fix(deps): remove `@types/node` from dependency tree For some reason, TypeScript is including references to `@types/node` in the generated types. See https://github.com/octokit/types.ts/pull/656 See... — committed to octokit/oauth-app.js by wolfy1339 2 years ago
- fix(deps): remove `@types/node` from dependency tree (#579) For some reason, TypeScript is including references to `@types/node` in the generated types. See https://github.com/octokit/types.ts/pull/... — committed to octokit/oauth-app.js by wolfy1339 2 years ago
- fix(deps): update octokit monorepo (#200) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@octokit/rest](https://red... — committed to kunalnagarco/action-cve by renovate[bot] 2 years ago
We still have this issue to contend with, https://github.com/esm-dev/esm.sh/issues/995.
I got rid of all
@types/nodeon the Octokit side of thingsI got
deno checkto work:Try using
@octokit/openapi-webhooks-types-transitionWill be fixed by https://github.com/octokit/types.ts/pull/656
The
octokitmodule is built on multiple other Octokit libraries packaged together, like@octokit/core,@octokit/app,@octokit/webhooks.Sorry, I meant export map https://nodejs.org/api/packages.html#exports
It defines the exports of that package, in that case, there’s 2 exports.
./is the main entrypoint./typesis a special entrypoint to access some types not exported in the main entrypoint but needed elsewhere.The problem lies with esm.sh not using the export map in order to map the import to the correct file.
In the mean time, try adding the following to your scopes
Also, to prevent any type errors ditch the
@octokit/webhooks-typespackage in favour of the@octokit/openapi-webhooks-typespackage. The former are not compatible with v4 of Octokit