On a mac:
> deno test bad_module.ts
No such file or directory (os error 2)
Versus:
> deno run bad_module.ts
Cannot resolve module "file:///Users/kkelly/github/deno/bad_module.ts"
The deno run is far more informative and consistent across OSes.
I think No such file or directory (os error 2) is actually the better error message here. The deno run error message suggests we're doing unnecessary processing. The process should try to open the file, and simply error out if it's not there. Certainly it shouldn't be booting up V8.
My only argument is that it should be normalized across OSes and should include the full path that was attempted to be resolved. Sometimes with complex relative URLs, it might hard to determine what is what.
Tested on 1.4.0
▶ deno test bad_module.ts
error: Cannot resolve module "file:///Users/biwanczuk/dev/deno/bad_module.ts" from "file:///Users/biwanczuk/dev/deno/.deno.test.ts"
Imported from "file:///Users/biwanczuk/dev/deno/.deno.test.ts:1"
~/dev/deno run_watch_unload ✔ 19m ⍉
▶ deno run bad_module.ts
error: Cannot resolve module "file:///Users/biwanczuk/dev/deno/bad_module.ts"
Seems this issue is resolved.
Most helpful comment
My only argument is that it should be normalized across OSes and should include the full path that was attempted to be resolved. Sometimes with complex relative URLs, it might hard to determine what is what.