Forum Discussion
umamaheswarSP2019
May 31, 2023Copper Contributor
why SPFX local debugging is extremely slow ?
I am experiencing significant slowness while attempting to debug my SharePoint Framework (SPFx) projects locally. The debugging process takes an excessive amount of time, impacting my development wor...
Leland Usher
May 31, 2023Brass Contributor
Hi, simple question, are you on a powerful machine? In terms of RAM, CPU? My old machine did not have enough CPU/RAM power and it my solutions compiled slowly.
- Don KirkhamJun 06, 2023MVP
A few options:
- When you say debug, do you mean commands like ```npm ``` or ```gulp serve```. Or are you referring to the actual VS Code debugging profiles and tools?
- Are you on a Windows machine?
- Make sure your project code is not in a location that uses active malware scanning, which will scan every file when installed of changed. This might be configured by your IT department if on a company asset. I have seen this cause a typical 3-4 minute ```npm i``` take over 20 minutes. Sometimes there is a special path where the live scans are not performed, so putting your code there will help.
- If possible, look into WSL, which takes a little setup, but is much faster than using the Windows file system.
- There is a tool called spfx-fast-serve (https://github.com/s-KaiNet/spfx-fast-serve) that drastically improves speed during debugging by only "re-compiling" the files that have changed instead of the whole project.
- The option to get a better machine is always a possibility, but I routinely work on 3-4 year-old Win10 machines with WSL and they perform quite well.
Good luck!Don
If my answer helps solve or resolve your issue, please consider clicking Mark as Best Response & Like. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it a Like.