Skip to content

Differing case in paths causes build to fail with rootDirs on Windows #10474

Closed
@BigDataSamuli

Description

@BigDataSamuli

TypeScript Version: nightly (2.1.0-dev.20160822)

Code

Windows 10 / Command prompt:

git clone https://github.com/BigDataSamuli/ts-rootdirs-case.git
cd ts-rootdirs-case
npm install
npm run build1
npm run build2

Expected behavior:

Both builds should succeed.

Actual behavior:

Build2 fails with error foo/src/foo.ts(1,22): error TS2307: Cannot find module './common'.

The only difference between the build commands (defined in package.json) is that build1 runs tsc -p foo while build2 runs tsc -p Foo (capitalized first letter). Based on the module resolution trace, the capitalized letter seems to cause problems in the module resolution logic.

This is the most minimal repro I could come up with. The real issue was encountered in VS Code. If you open the repo folder in VS Code and run the build task the task fails with the abovementioned error. The build task runs npm run build1, which succeeds when run from the command prompt. Looking at the trace, it seems like some of the paths end up having a lowercase drive letter, while all the letters are uppercase in the version run from the shell. I presume this differing case is the underlying issue in both cases.

Additional observation: if foo/src/app.ts is renamed to main.ts or anything else that comes after foo.ts in aphabetical order, all the builds succeed, both in VS Code and from the shell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions