tsc -b
produces different outcomes with same inputs (using project references & typescript@beta
)
#33770
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
TypeScript Version: typescript@beta (
3.7.0-beta
)Search Terms:
Project references, compilation fails, tsc -b, yarn tsc -b, yarn workspaces, monorepo
Context:
I've got a similar project set up as https://github.com/RyanCavanaugh/learn-a. Mine also uses yarn-workspaces.
I want to be able to run
tsc -b
(globaltypescript
installation) and/ortsc -b -w
(localtypescript
installation, defined inpackage.json
). I've tried both.Expected behavior:
I'm able to consistently get the same output with the same inputs.
Actual behavior:
With the same inputs (source files) the compiler sometimes successfully compiles, and sometimes it fails with errors:
<filename>:69:420 - error TS2307: Cannot find module '@my-project/local-package'.
I've had a higher success rate with the global
tsc -b
rather than the localyarn run tsc -b
by the way. It seems that if one's failing, removing the generateddist
files and running the other will work. Strange.Playground Link:
https://github.com/sarpik/turbo-schedule
Related Issues:
#32028 (comment)
#20148
#26867
#26689
Edit:
I thought this was a problem between
tsc -b
andyarn run tsc -b
, but it isn't - running the compiler either way sometimes fails and sometimes succeeds.Could this be with my
purge:build
script? It just removes the./client/build
and./*/dist
, making the project available to be cleanly rebuilt.Edit v2:
After moving all of my projects'
typescript
dependency fromdevDependencies
todependencies
, the issue seems to occur a little rarer, but it still happens quite a lot.The text was updated successfully, but these errors were encountered: