Skip to content
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

TS does not recompile correctly when using a combination of project references, wildcard re-exports and watch mode #35468

Open
wereHamster opened this issue Dec 3, 2019 · 0 comments

Comments

@wereHamster
Copy link

@wereHamster wereHamster commented Dec 3, 2019

The simplest example I could come up with is this (full example available as github repo):

Setup: Two projects, main and pure. The index file of pure uses a wildcard re-export from another file which defines an interface type. The main project uses the interface type.

I start tsc in watch mode. Then I add a field to the interface type, which should cause a type error in the main project, but tsc remains quiet, reporting no errors. Restarting tsc does not help.

Observations:

  • TypeScript reports the error when not started in watch mode (ie. when I start it manually once before making the change, and then again after making the change).
  • TypeScript reports the error when I import the session.ts file directly instead of going through the pure/index.ts file.
  • VS Code (TS 3.7.2) reports type error correctly.

Search Terms: project references, reexports

Code: https://github.com/wereHamster/typescript-project-references-reexport-bug

Clone the repo, install tsc (I tried with 3.8.0-dev.20191203), start tsc in watch mode (./node_modules/.bin/tsc --build src), and then add a new field to the Session type (file: src/pure/session.ts), and save the file.

Expected behavior: tsc should report a type error in the src/main/index.ts file, where the Session type is used.

Actual behavior: tsc remains quiet and does not report any errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.