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

Path mappings have unintuitive behavior if user accidentally adds an extension #12098

Closed
DanielRosenwasser opened this issue Nov 8, 2016 · 1 comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Nov 8, 2016

Was with @zhengbli when we hit the following:

tsconfig.json:

{
    "compilerOptions": {
        "baseUrl": ".",
    	"paths": {
             "foo": ["foo.ts"]
        }
    }
}

foo.ts

export function blah() { }

hello.ts:

import * as x from "foo";

Right now you'll get an error on the import that foo couldn't be resolved.

Even the documentation currently states (incorrectly) that this should be a valid (though the website isn't up to date). Perhaps we should allow users to specify the extension.

@vladima
Copy link
Contributor

vladima commented Nov 8, 2016

it used to work, seems it was broken in this PR. @andy-ms, can you please take a look

@vladima vladima added the Bug A bug in TypeScript label Nov 8, 2016
@mhegazy mhegazy assigned ghost Nov 8, 2016
@mhegazy mhegazy added this to the TypeScript 2.1.2 milestone Nov 8, 2016
@ghost ghost closed this as completed in #12103 Nov 11, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 13, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants