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

Report original file and line for unsupported scheme when compiling #5080

Closed
dstaley opened this issue May 4, 2020 · 1 comment · Fixed by #5817
Closed

Report original file and line for unsupported scheme when compiling #5080

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

Comments

@dstaley
Copy link

dstaley commented May 4, 2020

One of my source files mistakenly had the following import:

import { HelloResponse } from "c:/Users/Dylan/Desktop/kinto-http.deno.ts/kinto-http/types";

When compiling, the following error was given:

Compile file:///C:/Users/Dylan/Desktop/kinto-http.deno.ts/test.ts
error: Uncaught Error: Unsupported scheme "c" for module "c:/Users/Dylan/Desktop/kinto-http.deno.ts/kinto-http/types". Supported schemes: [
    "http",
    "https",
    "file",
]
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at async processImports ($deno$/compiler/imports.ts:117:23)
    at async processImports ($deno$/compiler/imports.ts:125:7)
    at async processImports ($deno$/compiler/imports.ts:125:7)
    at async processImports ($deno$/compiler/imports.ts:125:7)
    at async Object.processImports ($deno$/compiler/imports.ts:125:7)
    at async compile (file:///D:/a/deno/deno/cli/js/compiler.ts:144:31)
    at async tsCompilerOnMessage (file:///D:/a/deno/deno/cli/js/compiler.ts:359:22)
    at async workerMessageRecvCallback ($deno$/runtime_worker.ts:73:9)

It would have been really nice if Deno had reported the original filename and line number containing the invalid import instead of just reporting the filename being executed.

@bartlomieju bartlomieju self-assigned this May 4, 2020
@drodsou
Copy link

drodsou commented May 10, 2020

I did not find info about not being able to use "C:/somedir/..." in Deno imports on Windows.

Is this a bug or some expected behaviour?

If it's expected behaviour it is inconsistent with e.g. readFile

let file = 'c:/tmp/mod.ts';

Deno.readTextFileSync(file);   
// works

await import(file);  
// error: thread 'main' panicked at 'internal error: entered unreachable code', cli\state.rs:492:12 
// note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.

3 participants