Skip to content

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

Closed

Description

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.

yarn add typescript@3.9.0-dev.20200312

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:

Activity

  1. warrenfalk commented on Mar 15, 2020

    @warrenfalk
    Author

    Sheetal Nandi (@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?

  2. sheetalkamat commented on Mar 16, 2020

    @sheetalkamat
    Member

    Don't repro the issue at all:

    image

  3. warrenfalk commented on Mar 16, 2020

    @warrenfalk
    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?

  4. sheetalkamat commented on Mar 16, 2020

    @sheetalkamat
    Member

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

  5. warrenfalk commented on Mar 16, 2020

    @warrenfalk
    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.

  6. RyanCavanaugh commented on Mar 16, 2020

    @RyanCavanaugh
    Member

    Warren Falk (@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions