Failed to import - octokit (types)
Failing module
- GitHub: https://github.com/octokit/octokit.js
- npm: https://www.npmjs.com/package/octokit
import { App } from "https://esm.sh/octokit"
Error message
from a blank directory:
$ deno run -A -r https://esm.sh init
$ deno task esm:add octokit
make test.ts with the following contents:
import { App } from "https://esm.sh/octokit"
After running deno check test.ts I got this:
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/[email protected]/X-ZS8q/dist-types/octokit.d.ts"
at https://esm.sh/v135/[email protected]/X-ZS8q/dist-types/octokit.d.ts:4:59
Additional info
- esm.sh version: v135
- Deno version: v2.0.6
at first I thought this might be an octokit issue (I had found something else already). I opened an issue there first and they showed the mapping exists.
This issue was already fixed in @octokit/app
https://github.com/octokit/app.js/pull/583
I'm thinking you meant the other issue, where it can't resolve @octokit/core/types
$ 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/[email protected]/X-ZS8q/dist-types/octokit.d.ts"
at https://esm.sh/v135/[email protected]/X-ZS8q/dist-types/octokit.d.ts:4:59
Which has to do with exports map, and a type only import
@wolfy1339 yes. I linked to both issues. I pasted the wrong logs here.
@wolfy1339 although idk why but https://esm.sh/octokit still seems to be resolving to the older version of @octokit/app
i will look into it
seems it's the type checking changed in deno 2, deno 1.x works fine
related to https://github.com/denoland/deno/issues/25762
That particular issue was resolved, it was a bug in the package. Can you please update @octokit/app on esm.sh
You need to force it to use @octokit/[email protected] in order to actually experience the issue described here
@wolfy1339 thanks
I'm not sure we understood each other.
The previous comment I made was about the file web.d.ts not existing and not about the issue as a whole.
The issue is still going on, and it isn't about module augmentation in types but package.json exports.
ESM.sh isn't resolving the import of @octokit/core/types to @octokit/core/dist-types/types.d.ts as defined in the exports map in the package.json
https://unpkg.com/browse/@octokit/[email protected]/package.json#L64