Skip to content

No error for importing unknown module using import "mod" syntax #4561

Closed

Description

import "someUnknownFile";

expected to see an error for "can not find module "someUnknownFile"".

Activity

  1. added
    Bug
    Breaking Change
    on Aug 31, 2015
  2. weswigham commented on Aug 31, 2015

    @weswigham
    Member

    If ES loaders are definable at runtime, how can we suppose to know how an import is going to resolve? Are we just going to try to (simultaneously) support the Browser loader and the Node loaders? Or can we provide a facility for describing how a loader resolves a module name and finds the code associated with it?

  3. mhegazy commented on Aug 31, 2015

    @mhegazy
    ContributorAuthor

    the compiler emulates the resolution loigic for imports in general. so import d from "myPackage" will resolve to node_modules\myPackage\index.d.ts assuming you are using CommonJs, and will give you an error if you are using AMD/UMD/SystemJS.

    the issue is our error reporting now depends on the typechecker needing the module symbol to check something against it. in the case of import "mod" the symbol is never needed, so the checking never happens.

  4. added
    Won't Fix
    on Sep 18, 2015
  5. mhegazy commented on Sep 18, 2015

    @mhegazy
    ContributorAuthor

    Avoid the breaking change, and the current behavior is not impacting correctness.

  6. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeBugWon't Fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions