logo
search
OneDrive File Issues

How to Fix OneDrive and Visual Studio Code Sync and Performance Issues

Muhammad TalhaMuhammad Talha Oct 20, 2026 869 views

Question details

A React or Node.js TypeScript project fails to sync, compile, or run correctly in Visual Studio Code after being moved to OneDrive.

How to Fix OneDrive and Visual Studio Code Sync and Performance Issues
Product
OneDrive and Visual Studio Code
Device & OS
Windows
Scenario
Developing Node.js or React applications in Visual Studio Code on a Windows machine where OneDrive backup is enabled for the Desktop or Documents folders.
Observed behavior
Visual Studio Code compiles indefinitely, npm start takes several minutes, files show unreadable code, and extensions appear missing due to incomplete OneDrive sync or Files On-Demand placeholders.
Before you start

Ensure your device has an active and stable internet connection to complete any pending OneDrive syncs, and close Visual Studio Code completely before modifying or moving your project directories.

Solution 1Recommended

Move the Project Outside of OneDrive and Reinstall Dependencies

Relocating your development project to a local directory prevents OneDrive from constantly syncing thousands of node_modules files, which degrades Visual Studio Code performance.

OneDrive is not designed to handle the massive number of small files generated by Node.js projects. Moving the project to a non-synced local folder is the most reliable way to restore compiler speeds and prevent file corruption.

1
Create a local development folder

Open File Explorer, navigate to your local drive (e.g., C:\), and create a new folder specifically for development, such as C:\Dev.

2
Copy your project

Locate your broken project inside the OneDrive folder, copy the entire project folder, and paste it into your new local development directory.

3
Delete dependency folders

In the new local directory, delete the node_modules folder and the package-lock.json file to clear any corrupted or incorrectly linked dependencies.

4
Reinstall dependencies

Open the newly copied project folder in Visual Studio Code, open the integrated terminal, and run npm install to download fresh dependencies.

5
Start your development server

Run npm start to verify that the indefinite compilation issue is resolved and performance has returned to normal.

Move the Project Outside of OneDrive and Reinstall Dependencies
Best Practice: Always keep Node.js, React, and other development projects with massive dependency folders outside of cloud-synced directories to ensure optimal compiler performance.
Free Microsoft Office alternative

Avoid Sync Frustrations with WPS Office

If Microsoft 365 and OneDrive sync issues are interrupting your workflow, consider switching to WPS Office. It provides a lightweight, highly compatible, and user-friendly experience for all your document creation needs without forcing unwanted automatic cloud backups of your critical local folders.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the application: Run the installer and follow the on-screen instructions to quickly set up WPS Office on your device.
  3. 3. Open and edit your files: Easily open your existing Word, Excel, and PowerPoint documents directly in WPS Office with full formatting preserved.
100% compatible with Microsoft Office formats (.docx, .xlsx, .pptx).Lightweight installation that doesn't drag down your system performance or conflict with local development environments.Built-in cloud storage options that you control, preventing the unwanted automatic syncing of massive directories.Free to use with a familiar, tabbed user interface that makes transitioning seamless.
microsoft office alternative - wps office

Frequently Asked Questions

Why does npm start take several minutes when my project is in OneDrive?

OneDrive's 'Files On-Demand' feature offloads files to the cloud to save space. When a build tool like Webpack tries to read thousands of files in your node_modules folder, OneDrive has to download them on the fly, causing massive delays and indefinite compilation times.

How can I stop OneDrive from automatically syncing my Desktop and Documents?

Open OneDrive settings by clicking its icon in the taskbar, go to 'Sync and backup', click 'Manage backup', and toggle off the specific folders (like Desktop or Documents) that you no longer want OneDrive to automatically back up to the cloud.

Can I tell OneDrive to ignore the node_modules folder?

Unfortunately, OneDrive does not currently have a reliable built-in feature to ignore specific subfolders (like a .gitignore file does for Git). The standard best practice is to move your entire development project to a local directory outside of the OneDrive path.

How do I fix missing image extensions after a OneDrive sync issue?

Open File Explorer, go to the 'View' tab, and ensure 'File name extensions' is checked. If the files were actually corrupted during the sync process, right-click the affected file and use OneDrive's 'Version history' to restore a previously working copy.