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 (node: protocol imports getting transformed to use @types/node) #995

Open
wolfy1339 opened this issue Jan 8, 2025 · 1 comment
Labels
deno Not working in Deno

Comments

@wolfy1339
Copy link

wolfy1339 commented Jan 8, 2025

Failing module

import { Octokit } from "https://esm.sh/octokit"

Note: you need to add the required resolution for @octokit/core/types to point to @octokit/core/dist-types/types.d.ts, see #918

Error message

After running deno run I got this:

error: Relative import path "http" not prefixed with / or ./ or ../ and not in import map from "https://esm.sh/v135/@types/[email protected]/http.d.ts"
  hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:http").
    at https://esm.sh/v135/@types/[email protected]/http.d.ts:1887:19

Additional info

  • Deno version: deno 2.1.4 (stable, release, x86_64-unknown-linux-gnu)
    v8 13.0.245.12-rusty
    typescript 5.6.2

The issue here is that esm.sh is transforming every node: protocol import to use @types/node which causes issues when trying to import using deno

@ije
Copy link
Member

ije commented Jan 9, 2025

this issue is related to denoland/deno#23007

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

No branches or pull requests

2 participants