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

Failed to import - octokit (types) #918

Open
ThisGuyCodes opened this issue Nov 19, 2024 · 9 comments
Open

Failed to import - octokit (types) #918

ThisGuyCodes opened this issue Nov 19, 2024 · 9 comments
Labels
deno Not working in Deno types Types is wrong

Comments

@ThisGuyCodes
Copy link

ThisGuyCodes commented Nov 19, 2024

Failing module

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
@ThisGuyCodes ThisGuyCodes added the deno Not working in Deno label Nov 19, 2024
@ThisGuyCodes
Copy link
Author

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.

@wolfy1339
Copy link

This issue was already fixed in @octokit/app
octokit/app.js#583

@wolfy1339
Copy link

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

@ThisGuyCodes
Copy link
Author

@wolfy1339 yes. I linked to both issues. I pasted the wrong logs here.

@ThisGuyCodes
Copy link
Author

@wolfy1339 although idk why but https://esm.sh/octokit still seems to be resolving to the older version of @octokit/app

@ije
Copy link
Member

ije commented Nov 20, 2024

i will look into it

@ije ije added the types Types is wrong label Nov 20, 2024
@ije
Copy link
Member

ije commented Nov 20, 2024

seems it's the type checking changed in deno 2, deno 1.x works fine
Screenshot 2024-11-20 at 16 34 15
Screenshot 2024-11-20 at 16 34 49

@ije
Copy link
Member

ije commented Nov 20, 2024

related to denoland/deno#25762

@wolfy1339
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno Not working in Deno types Types is wrong
Projects
None yet
Development

No branches or pull requests

3 participants