Skip to content

ModuleResolution doesn't work correctly. #664

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

Closed
isuda opened this issue Oct 15, 2015 · 7 comments
Closed

ModuleResolution doesn't work correctly. #664

isuda opened this issue Oct 15, 2015 · 7 comments

Comments

@isuda
Copy link

isuda commented Oct 15, 2015

I have a project with a tsconfig.json that is compiled externally (and also does not generate d.ts files).

tsc will compile the project correctly, but atom will output lots of "module not found" errors when I use the node style module resolution. When I do add compileOnSave: true. It warns me that "the compile failed, but the emit succeeded".

image

If it works for tsc, it should work for atom-typescript?

@isuda
Copy link
Author

isuda commented Oct 15, 2015

I should also note that changing the import to import {Test} from "./test/index" works, but of course, thats the same as if I were using moduleResolution: "classic".

@basarat
Copy link
Member

basarat commented Oct 15, 2015

Which version of tsc are you using. Importing a .ts file without a .d.ts file was only fixed 3 days ago :) microsoft/TypeScript#5225

But last time we updated to TypeScript latest people's code broke so haven't done a quick push. Tracking it here though #663 🌹

@basarat
Copy link
Member

basarat commented Oct 15, 2015

PS: can you copy paste the code files here ... so I don't have to setup for testing :)

@isuda
Copy link
Author

isuda commented Oct 16, 2015

My tsc version is 1.6.2.

tsconfig.json:

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "declaration": false,
        "noImplicitAny": false,
        "removeComments": false,
        "noLib": false
    },
    "compileOnSave": true,
    "filesGlob": [
        "./**/*.ts"
    ],
    "files": [
        "main.ts",
        "test/index.ts"
    ],
    "exclude": []
}

main.ts:

import {Test} from "./test";

let t = new Test();

test/index.ts:

export class Test {

}

@basarat
Copy link
Member

basarat commented Oct 16, 2015

I just tried typescript latest locally. Bug still exists. Reported here microsoft/TypeScript#5277 🌹

basarat added a commit to TypeStrong/atom-typescript-examples that referenced this issue Nov 11, 2015
@basarat
Copy link
Member

basarat commented Nov 13, 2015

@isuda
Copy link
Author

isuda commented Nov 13, 2015

Thanks!

@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
angelestelar5z added a commit to angelestelar5z/atom-typescript that referenced this issue Aug 17, 2024
…there. Closes TypeStrong/atom-typescript#664 closes microsoft/TypeScript#5277

feat(tsconfig) expand automatic compilation to lookup .tsx files (and also index for imports)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants