-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Strange build behaviour building TypeScript from VSCode with Node v6 on Windows #6719
Comments
Update: Executing |
@yortus trying this from the command line results in the following error for me: error TS5009: Cannot find the common subdirectory path for the input files. Interestingly I frist tried this under node version 5.10.0 and there it worked in both command line and VS Code. |
The task frameworks sets cwd to the workspace folder by default if not provided. So I don't understand why setting it explicitly makes it work. Need to investigate. |
@dbaeumer I don't get TS5009, the build runs successfully for me. I had a colleague repeat the repro steps on his machine and he has the same results as I've written up in the OP. I don't have |
I've just followed the repro steps on another machine (Windows 10, Node 6.2, VSCode 1.1) and got the same results again. Repros consistently for me so far on three machines now. |
I do have tsc installed globally. Will uninstall and try again. |
Using the local installed tsc produces the same TS error for me.
No idea what makes the difference here. |
When I change tsconfig.json to: {
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "../built",
"rootDir": "../src"
}
} and compile using
I get
|
Using tsc version 1.8.10 works without any problem. |
Yep, TS1.8 works fine for me too. I can only repro the problem with ts@next (it repros with today's nightly build for me). I can't get a TS5009 however I try, nor would I expect a TS5009 for such a trivial project structure where the two source files clearly share the common root Could you try expanding out the
That repros the same error for me. |
I've just repro'd this on another different machine (Windows 7). This was a clean machine, I had to install Node, GIT and VSCode. Behaves exactly as described in OP. Is it possible the TS5009 error you get is somehow related to the bug? The problem is path confusion after all. And clearly the two files I mean, how else could you structure a two-file project, with one file nested in a subdirectory, if tsc can't work out the common root? Do you still get TS5009 on your machine if you run |
A clue... in |
This may be an issue in TypeScript instead. I've tracked the issue down to microsoft/TypeScript@cd1af12 |
I think @Seikho is onto something in this comment. If I add |
@dbaeumer are you using symlinks? The commit referenced by @Seikho affects symlink behaviour, and you reported getting an error like:
...which looks like a symlink expanded in one place but not in another. |
@yortus @Seikho very good insights. I am not using symlinks. I use subst to create a new drive letter that points into my C-Drive. E.g. P:\ => 'C:/Users/dirkb/Projects. I should have spotted that in the error message as well. Regarding setting the cwd as pointed out in comment #6719 (comment): VS Code by default sets the cwd to the workspace folder. However we set the cwd with a lower case drive letter. |
On top of that there seems to be issue with drive letter in node 6.x: See nodejs/node#6624. @yortus @Seikho any objection to close this issue. IMO there is little VS Code can do here. The fix should be on TS side to deal correctly with drive letter casing. We internally consistently make it lower case when normalizing paths. |
@dbaeumer agreed - will follow up in Microsoft/TypeScript#8837. |
I was just writing a post that came to the same conclusion. Thanks @dbaeumer |
Closing in favour of microsoft/TypeScript#8837 |
Steps to Reproduce:
See https://github.com/yortus/repro-build-bug for full repro details and a cut-down project.
From the README:
Bug Repro
Problem Description
Shift+Ctrl+B
puts some built files in the wrong locationEnvironment
Steps to Reproduce
Project setup
git clone https://github.com/yortus/repro-build-bug.git
cd repro-build-bug
npm install
Baseline build/run (this should work fine)
npm run build
/built
will contain built.js
filesnode .
"Hello, World!"
to consoleVSCode build/run (this should repro the bug)
/built
directory created in the previous stepsShift+Ctrl+B
.js
file is output to/built
and the other to/src
node .
"cannot find module..."
because of the wrong placement of built filesFurther Notes
"options": {"cwd": "<absolute project path>"}
is added to.vscode/tasks.json
The text was updated successfully, but these errors were encountered: