question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript: Slow compilation time

See original GitHub issue

Now that create-react-app now natively supports typescript, I gave it a try. I expected near instant compilation times after making a change to a file, just like with JavaScript. Instead, I got about 3-5s of delay on the official typescript cra (out of the box). I thought this delay would disappear after moving to babel 7, I thought we simply strip off TypeScript when running the dev server and properly compile TypeScript and check for errors when building the production build? Is this possible?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:47
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
hlthicommented, Dec 14, 2018

how are people working around this issue? I normally do everything i can to avoid ejecting but this is unbearable?

Just change tsconfig.json , “skipLibCheck” : true

17reactions
td0mcommented, Nov 17, 2018

@ianschmitz Changing the ForkTsCheckerWebpackPlugin config async to true and silent to false seems to fix both the issues you stated above. Errors are perfectly displayed. 5820 1.

Obviously, because async is enabled and the ts checking takes more than the babel process, the errors are displayed with a delay.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tsc compilation slow on moderate sized project #37635 - GitHub
I'm trying to debug why my typescript compiler is taking 9-13 seconds to recompile. This impacts ts-node and development drastically. typescript ...
Read more >
How to speed up your TypeScript project? - The Software House
In its raw form, running the `npm run watch` command (which starts the TypeScript Compiler – tsc – in a watch mode) takes...
Read more >
TypeScript 4.6 - Compilation is too slow at least for me with ...
TypeScript 4.6 - Compilation is too slow at least for me with 50000 lines of code, moving back to pure JS.
Read more >
Optimizing TypeScript - Wallaby.js
There's one more method that we can use to compile TypeScript, swc. The average time to compile our project with swc is 0.461...
Read more >
Typescript background compilation is very slow, sometimes ...
I want to use compile on save feature, turning it off is not an option, because running gulp/watch is a pain, gets stuck...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found