DEV Community

Yusuf-Esilokun, Hamid
Yusuf-Esilokun, Hamid

Posted on

How to Fix "Slow Filesystem Detected" in Next.js

Encountering the “Slow filesystem detected” warning in Next.js can be frustrating, especially for beginners. Even when your project folder is correctly placed in a local directory (e.g., C:/), the warning might persist, preventing your project from running.

In this article, you'll learn simple and effective steps to troubleshoot and resolve this issue.

Understanding the Issue
When running a Next.js project, you might see an error like:

Slow filesystem detected. If C:\Users\HP\… is a network drive, consider moving it to a local folder.

slow file sys

This warning usually occurs due to Windows security restrictions or conflicts with existing processes. Follow these steps to resolve it.

Step 1: Ensure Your Project is in a Local Directory
Before troubleshooting further, make sure your project folder is in
a local directory (C:/). If it's already in the right location,
proceed to the next step.

Step 2: Add Your Project Folder to Microsoft Defender Exclusions
Windows Defender may slow down file access in your project folder.
To prevent this, add your project to the exclusion list:

  1. Open Windows Security on your PC.
  2. Navigate to Virus & Threat Protection → Manage Settings.
  3. Scroll down to Exclusions and click Add or Remove Exclusions.
  4. Add your project folder to the list.

After this, restart your IDE and proceed to the next step.

Step 3: Reinstall Dependencies
To rule out dependency issues, follow these steps:

  1. Delete the node_modules folder and the yarn.lock (or package- lock.json) file.
  2. Run npm install or yarn install to reinstall dependencies.
  3. Start your project again using: npm run dev or yarn dev Step 4: Check for Conflicting Processes If the terminal gets stuck at “Ready in …s”, another process may already be using port 3000. To check:
    1. Run the following command in your terminal: netstat -ano | findstr :3000
    2. If a process ID (PID) appears, terminate it using: taskkill /PID /F
    3. Try running your project again.

Alternatively, you can change the port using:
npm run dev -p 4000
Then, access your project at http://localhost:4000.

Step 5: Clear Browser Cache
If the issue still isn't resolved, try running your project in
incognito mode. If it works there, the problem is likely due to
cached data. Clear your browser cache and cookies, then reload your
project.

Conclusion
By following these steps, you should be able to resolve the 'Slow
filesystem detected' warning in Next.js. If the problem persists,
consider checking for additional system-level security settings that
might be affecting file access.

Top comments (0)