Fix for TypeScript issues with yarn start #52036
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a tentative fix for some intermittent issues we've been seeing with TypeScript and running
yarn start
. Specifically, we've noticed that occasionally TypeScript will fail to recognize the@cdo/apps
path defined in tsconfig.json, saying the file does not exist, but only when runningyarn start
. When this occurs, we've noticed thatyarn build
succeeds.The fix here is to remove the
ts
task from the list of watch tasks run duringyarn start
. I believe this was causing some issues where TypeScript was getting built too early/out of sync, and thewebpack:watch
step should take care of compiling TypeScript anyway.I've also included some small test changes which updates JS import paths in a .tsx file from
require
toimport
. These changes were initially failing to build for me, but after updating the Gruntfile, they build successfully.Links
https://codedotorg.atlassian.net/browse/SL-861
Testing story
Tested locally by first running
yarn clean
and manually deleting the .tscache folder. Then separately ran both yarn build and yarn start and confirmed that there were no build issues, and new changes were building.