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.

React-scripts/fork-ts-checker-webpack-plugin constant high CPU usage when using material/icons

See original GitHub issue

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes.

Which terms did you search for in User Guide?

fork-ts-checker-webpack-plugin and react-scripts combined with: slow stuck cpu 100% cpu pegged

Environment

npx: installed 1 in 2.147s Path must be a string. Received undefined C:\Users\Tamas\AppData\Roaming\npm\node_modules\create-react-app\index.js

Environment: OS: Windows 10 Node: 8.11.4 Yarn: Not Found npm: 5.6.0 Watchman: Not Found Xcode: N/A Android Studio: Not Found

Packages: (wanted => installed) react: ^16.8.1 => 16.8.6 react-dom: ^16.8.1 => 16.8.6 react-scripts: 2.1.8 => 2.1.8

Steps to Reproduce

  1. Install @material/icons
  2. import { AccessAlarm } from “@material-ui/icons”; in App.tsx
  3. npm start

Expected Behavior

Once it has finished building, the cpu usage should become minimal.

Actual Behavior

One of the node processes, more specifically the fork-ts-checker-webpack-plugin, flips out and pushes the CPU non-stop (I left it there overnight and was still running high the day after)

Importing an icon in the wrong way (https://www.npmjs.com/package/@material-ui/icons) completely kills the node process.

Reproducible Demo

Demo: https://stackblitz.com/edit/react-gv75il

A more illustrative way to see this happening is by trying it out locally. Then monitor the cpu usage of the fork-ts-checker-webpack-plugin.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

11reactions
johnnyreillycommented, Apr 20, 2019

See https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/256 - we’re currently mulling what the best way forward is. But for now, setting this environment variable will resolve woes by all accounts: TSC_WATCHFILE=UseFsEventsWithFallbackDynamicPolling

3reactions
johnnyreillycommented, May 25, 2019

To spread the knowledge about this issue (and the workaround) I’ve blogged it here: https://blog.johnnyreilly.com/2019/05/typescript-and-high-cpu-usage-watch.html

Hope it helps people reading this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix High CPU Usage - Intel
Find out all the reasons why your PC displays high CPU usage. Our step-by-step guide will show you how to fix your CPU...
Read more >
Guidance for troubleshooting high CPU usage - Windows Server
Introduces general guidance for troubleshooting scenarios in which you experience high CPU usage.
Read more >
High CPU usage on machines with Deep Security Agent
Check which process encounters high CPU utilization: Windows: Task Manager; Linux/HPUX: top output; Solaris: prstat output; AIX: topas output. If ds_agent.exe ...
Read more >
What is CPU usage, and how to fix high CPU usage
Fortunately, there are several ways that will help you solve issues with high CPU usage. Check them out in our comprehensive guide below....
Read more >
How to Lower CPU Usage: Common Causes & Tips - N-able
Struggle with high CPU usage? Learn how to troubleshoot high CPU usage and fix high ram usage to avoid slow computers and decreased ......
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 Reddit Thread

No results found

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