How to Solve the "crbug/1173575, non-JS module files deprecated" Error
The error message crbug/1173575, non-JS module files deprecated, often accompanied by ERR_CONNECTION_REFUSED, is a common and frustrating issue when debugging JavaScript applications, especially in Visual Studio Code. This is not a code error but a connectivity error. It means your browser's debugger was unable to connect to your development server to load the necessary files.
This guide will walk you through a simple, step-by-step checklist to diagnose and fix the root cause of this connection problem.
The Core Problem: A Failed Connection
This error is your browser's debugger telling you: "I tried to launch your app and connect to http://localhost:3000, but no one answered." The crbug/... part is an internal Chromium bug tracker reference that has become associated with this general category of connection failures.
The solution is always to find and fix the reason the connection failed.
Your Debugging Checklist
Follow these steps in order. Most of the time, the problem will be solved by one of the first three.
Step 1: Is Your Development Server Running?
This is the most common cause of the error. The VS Code debugger does not automatically start your development server (npm start, vite, etc.). You must start it manually before you launch the debugger.
Solution:
- Open a terminal in your project's root directory.
- Run your server start command (e.g.,
npm startornpm run dev). - Wait for the server to compile and report that it is listening on a port (e.g.,
http://localhost:3000). - Keep this terminal running.
- Now, launch the VS Code debugger.
Step 2: Is Your Browser in "Offline" Mode?
Sometimes, the browser's developer tools can be accidentally set to "Offline" mode, which will block all network requests.
Solution:
- In your browser (Chrome/Edge), open the Developer Tools (F12).
- Go to the Network tab.
- Find the "Throttling" dropdown (it might just show an icon).
- Ensure it is set to No throttling or Online, not "Offline."
Step 3: Is Your launch.json URL Correct?
Your project's debugger configuration is stored in the .vscode/launch.json file. The url property in this file must exactly match the URL where your development server is running.
Solution:
- Check your terminal to see the exact URL your server is running on (e.g.,
http://localhost:3000). - Open your
.vscode/launch.jsonfile. - Verify that the
urlproperty matches. Pay close attention to the port number.{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
// This URL MUST match your running server's URL.
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
A common mistake is using https for a local http server.
Step 4: Are You Using the Correct Port?
Another application on your computer might already be using the port your development server is trying to use. Most modern tools (like Create React App) will automatically offer to run on the next available port (e.g., 3001). If this happens, your launch.json will be pointing to the wrong port.
Solution:
- Check the terminal output of your development server for the actual URL it is running on.
- Update your
.vscode/launch.jsonfile to match this URL.
Step 5: Is a Firewall or Proxy Interfering?
Corporate firewalls, VPNs, or proxy servers can sometimes block local connections.
Solution:
- Try temporarily disabling your firewall or VPN to see if the error goes away.
- As a test, try changing
localhostin yourlaunch.jsonURL to the loopback IP address127.0.0.1."url": "http://127.0.0.1:3000",
The "Reset Everything" Solution
If none of the above steps work, it's time to clear out any potentially corrupted state.
Solution:
- Close VS Code and your browser completely.
- Delete your project's
node_modulesfolder andpackage-lock.jsonfile (oryarn.lock). - Delete the
.vscodefolder in your project. - Re-run
npm install. - Re-run your development server (
npm start). - Go to the "Run and Debug" panel in VS Code and let it generate a fresh
launch.jsonfile for you, and then correct the URL if necessary.
Conclusion
The "crbug/1173575" error is a symptom of a simple problem: your browser cannot connect to your development server. By methodically working through the checklist, you can quickly identify and fix the underlying issue.
- Most often, the problem is either that the development server is not running or the URL in
launch.jsonis incorrect. - Always ensure your server is running before you start the debugger.
- Double-check that the port number in your configuration matches what the server is actually using.