Hot reloading breaks when encountering Typescript error
Created by: mikemklee
Describe the bug
I am having exactly same issue as metioned in https://github.com/facebook/create-react-app/issues/8055
Since that issue is now closed, I will just re-describe the issue again here.
Hot reloading seems to stop working when a Typescript compilation error is encountered. Any subsequent code changes would not trigger hot reloading after that, even if I fix the lines that would cause compile errror.
I need to actually close and restart the dev server in order to see my changes reflected.
Which terms did you search for in User Guide?
Typescript, Hot reloading
Environment
System:
OS: Linux 4.19 Ubuntu 18.04.2 LTS (Bionic Beaver)
CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
Binaries:
Node: 13.7.0 - /usr/bin/node
Yarn: 1.21.1 - /mnt/c/Program Files (x86)/Yarn/bin/yarn
npm: 6.14.2 - /usr/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
react: ^16.13.0 => 16.13.0
react-dom: ^16.13.0 => 16.13.0
react-scripts: 3.4.0 => 3.4.0
npmGlobalPackages:
create-react-app: 3.4.0
Steps to reproduce
create-react-app react-app --template typescript
cd react-app
yarn start
- Write invalid typescript code in
src/App.tsx
and save it to trigger compilation error - See TS compiler error message in terminal
- Fix the code in
src/App.tsx
and save it - Note that hot reloading is now NOT triggered
- Killing dev server and running
yarn start
again to see changes get reflected
Expected behavior
Re-compile and hot reload on every save, just like when using create-react-app
without the --template typescript
flag