deno icon indicating copy to clipboard operation
deno copied to clipboard

Deno is unable to reference imported typescript files without extension

Open MrSharpp opened this issue 1 year ago • 3 comments

Version: Deno 2.0.0

I am running my nest js project, in which when i try to run main.ts file it gave me this error:

error: Module not found "file:///D:/Github/ps-renderer-2.0/src/app.module". Maybe add a '.ts' extension or run with --unstable-sloppy-imports at file:///D:/Github/ps-renderer-2.0/src/main.ts:2:27

indicating that it didnt resolved the file imported by main.ts

MrSharpp avatar Oct 10 '24 11:10 MrSharpp

The solution is suggested in the error message: pass --unstable-sloppy-imports flags and it should work.

bartlomieju avatar Oct 10 '24 11:10 bartlomieju

oh sorry, i was passing this parameter but after that file. now i get this: error: Relative import path "@modules/pattern-size/pattern-size.module" not prefixed with / or ./ or ../ now in even in deno2 i need to create an import map to fix this issue?

MrSharpp avatar Oct 10 '24 12:10 MrSharpp

Could you share some more info about your project? Is there a repo i could take a look?

bartlomieju avatar Oct 10 '24 12:10 bartlomieju

Closing this the OP did not respond. @MrSharpp please re-open this PR if you can provide a full reproduction.

lucacasonato avatar Oct 18 '24 07:10 lucacasonato