Skip to content

Cannot resolve module without extension defined #2506

@Drag13

Description

@Drag13

Hi guys! First of all let me say big thanks for all the job you already done! Deno looks extremely promising even before release.

Right now I am trying to get a bit more familiar with it and just spotted some kind of issue (I think this is issue but may be I am wrong) when importing my own typescript module.

Let's say we have this code

import { Timer } from "./serivce";
const id = new Timer().start();

It looks OK, but Deno will refuse to run it because it expects to see extension of the file:

Uncaught NotFound: Cannot resolve module "./serivce"

If I will change statement to use extension, as Deno expect, two bad things happens.

  • VsCode starts showing next error:
    image

  • No IntelliSense provided because Timer starts to be "any" - typed

The first issue can be partially fixed using //@ts-ignore. But then, I have to add this every time, and that's a bit annoying. And the second issue seems not fixable for me (again, may be just not found the solution)

So my question: Is it possible to make Deno and Ts more friendly and get rid of this //@ts-ignore?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions