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

Deno has panicked error when importing types from index.d.ts file #14413

Closed
Lolicchi opened this issue Apr 27, 2022 · 0 comments · Fixed by #15678
Closed

Deno has panicked error when importing types from index.d.ts file #14413

Lolicchi opened this issue Apr 27, 2022 · 0 comments · Fixed by #15678
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@Lolicchi
Copy link

Lolicchi commented Apr 27, 2022

Im sorry Im reopening this issue I had this error and it wasn't coming from where I was thinking and it was fixed and i closed the issue but now I know where the error is coming from, I should have debugged more.

Im using https://www.npmjs.com/package/discord.js this npm commonjs library with --unstable --compat flag and im trying to import a type from the index.d.ts file they provide https://raw.githubusercontent.com/discordjs/discord.js/13.6.0/typings/index.d.ts
this is my code:

import { type ClientOptions } from 'https://raw.githubusercontent.com/discordjs/discord.js/13.6.0/typings/index.d.ts'

let options: ClientOptions

it also happens when doing

// @deno-types=https://raw.githubusercontent.com/discordjs/discord.js/13.6.0/typings/index.d.ts
export {
  Client,
  MessageButton,
  Message,
  MessageReaction,
  User
} from 'https://raw.githubusercontent.com/discordjs/discord.js/13.6.0/src/index.js'

and i get this error when running with RUST_BACKTRACE=1 and deno run --unstable --compat --no-check -A src/mod.ts
it looks for package.json in the typings folder

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.20.4
Args: ["C:\Users\dell\.deno\bin\deno.exe", "run", "--unstable", "--compat", "--
no-check", "-A", "src/mod.ts"]

thread 'main' panicked at 'Provided URL was not file:// URL: https://raw.githubuserc
ontent.com/discordjs/discord.js/13.6.0/typings/package.json', cli\compat\esm_resolve
r.rs:154:25
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtra
ce.

@Lolicchi Lolicchi changed the title Error when using // @deno-types=index.d.ts Deno has panicked error when using // @deno-types=index.d.ts Apr 27, 2022
@Lolicchi Lolicchi reopened this Apr 27, 2022
@Lolicchi Lolicchi changed the title Deno has panicked error when using // @deno-types=index.d.ts Deno has panicked error when importing types from index.d.ts file Apr 27, 2022
@kitsonk kitsonk added bug Something isn't working correctly node compat labels Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants