Skip to content

Project References Regression starting in Nightly 3.9.0-dev.20200313 #37406

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
warrenfalk opened this issue Mar 15, 2020 · 6 comments
Closed
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@warrenfalk
Copy link

Project References do not appear be honored in tsserver starting in Nightly 3.9.0-dev.20200313. This results in an error in Visual Studio code when importing from 'some-pkg/dist/file' when that file has not yet been built.

TypeScript Version: 3.9.0-dev.20200313 and later

Search Terms:

references tsserver

Code

Minimal reproduction project attached. repro.zip

This seems to be an issue with tsserver, and so I can only reproduce it in Visual Studio Code (not with tsc -b).

The error is a regression starting in version 3.9.0-dev.20200313. There was no error in 3.9.0-dev.20200312 and previous.

To reproduce, use attached repro.zip, here are simple instructions and the screenshot of the result.

unzip repro.zip
cd repro-ts-bug
yarn install
code .
code src1/one.ts

See issue in 3.9.0-dev.20200313:
image

This should work because of a project reference to src2/tsconfig.json from src1/tsconfig.json, and it does work in the previous build of typescript.


You can see this is a regression. Installing the previous version and reloading the window demonstrates no error.

And reload window. No issue in 3.9.0-dev-20200312

image

Expected behavior:

No error, as in second screenshot

Actual behavior:

Error:

Cannot find module '../dist2/two' or its corresponding type declarations.

Playground Link:
Unable to demonstrate project reference issues with playground (as far as I know)

Related Issues:

@warrenfalk
Copy link
Author

@sheetalkamat, it appears this problem began with the merge of PR #37370, "Move useSourceOfProjectReferenceRedirect to program so other hosts can use it too, enabling it for WatchHost" with commit a76a166

Is this a regression, or am I misunderstanding something about how this should work?

@sheetalkamat
Copy link
Member

Don't repro the issue at all:

image

@sheetalkamat sheetalkamat added the Needs More Info The issue still hasn't been fully clarified label Mar 16, 2020
@warrenfalk
Copy link
Author

Hmm, indeed, I can only reproduce it on this machine. It didn't occur to me to try other machines - sorry about that...

But something has definitely changed in 20200313, though, because on this machine every version before that works, but every version after does not.

I will try to see if I can see why. Are there any hints you can give that might explain why this might work on one machine, but not on a nearly identical machine?

@sheetalkamat
Copy link
Member

you could add --traceResolution and see whats going on in tsserver log..

@warrenfalk
Copy link
Author

Ah, it was a vscode extension that I long forgot was there; I should have thought of that. It appears to be interfering in some way that breaks after 20200313. I don't need the extension so I am just removing it rather than look deeper. Thanks for the pointer, and sorry about wasting your time.

@RyanCavanaugh
Copy link
Member

@warrenfalk glad we got it figured out; thanks for following up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

3 participants