Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crbug/1173575, non-JS module files deprecated. chromewebdata/(index)꞉5305:9:5551

I just created a new project and have run it for the first time using F5 or Ctrl + F5. The result in Chrome is:

The site can't be reached

err_connection_refused

I checked the option at the breakpoints for "Exceptions caught" and the following error is displayed.

Enter image description here

Without "Exceptions caught" checked, the next error raised:

Enter image description here

I tried to run "ng s -o" from the terminal and all work fine. The site is working well on port 4200, but I like to debug.

Here is my launch.json file, all by default:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:4200",
            "webRoot": "${workspaceFolder}"
        }
    ]
}

Why is this happening?

like image 939
Gheorghe Graur Avatar asked Apr 21 '21 07:04

Gheorghe Graur


People also ask

How do I fix this error Crbug 1173575 Non JS module files deprecated?

Solution One In such cases, the easiest way to deal with this error is to simply delete the launch. json file. As we know that Visual Studio Code will auto-generate this file for you while debugging and in most cases, this approach will solve the issue for you.

What is console warn (' Crbug 1173575 Non JS module files deprecated ');?

The error Crbug/1173575, non-JS module files deprecated occurs mainly if you are trying to debug the application in VSCode and Chrome browser. There are various reasons why you get the error. The issue can be resolved by deleting the launch.


21 Answers

I had the same issue and the problem was with the URL. It was https://localhost:8000; in place of http://localhost:8000.

So try checking your URL and routes.

like image 122
JoelSebstn Avatar answered Oct 05 '22 18:10

JoelSebstn


This misleading error message seemingly has nothing to do with Chrome or any deprecated functionality. It can have many root causes and seems to occur whenever connectivity can't be established.

I got this while following the React tutorial for Visual Studio Code. In that tutorial you start by creating a template with npx and then running it with npm start. That worked, and I could see that it was using http://localhost:3000 for the URL in the browser.

However, when I changed the code as the tutorial requested and set a breakpoint to debug, I got the error in the OP's post, both with Chrome and with Edge.

Visual Studio Code was creating a default launch.json file for debugging and populating it like this:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    "version": "0.2.0",
    "configurations": [
        {
            "type": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        }
    ]
}

And I needed to manually change the 8080 to 3000 which fixed the problem.

The key for me was configuring the breakpoint to catch the exception like the OP described (note - you can only configure that with the Debug icon selected in the far left icon menu). While the emitted error message is still the misleading "deprecated" one, there was a message that "the site can't be reached" which you can find if you dig a little - as shown here:

Enter image description here

I imagine that practically any configuration issue that causes the connection to fail will cause this error. So firewall issues, missing host program, bad configuration (like mine), etc.

like image 36
Mike Wise Avatar answered Oct 05 '22 18:10

Mike Wise


I also had this issue and none of the solutions listed were helpful. However, the problem was rather easy to solve.

Just go into the Network tab of the Chrome Developer Console. Be sure that the connection is on No throttling and not Offline.

Tutorial

like image 41
s0rana Avatar answered Oct 05 '22 18:10

s0rana


My server was just not running locally. :) Starting localhost solved it.

like image 36
Leon Avatar answered Oct 05 '22 17:10

Leon


Instead of launching your application using the option "Launch Chrome against localhost", rather set your application name for launching - Resolved.

See the attached image for more context.

Enter image description here

like image 32
Percy Kagiso Avatar answered Oct 05 '22 17:10

Percy Kagiso


In my case, it got resolved by closing the browser and recompiling the app.

like image 37
vsg Avatar answered Oct 05 '22 19:10

vsg


Console error message

I had this same error and I resolved it by turning off my plugins. Specifically a CORS plugin I have been using.

like image 44
nikki ricks Avatar answered Oct 05 '22 17:10

nikki ricks


For me, the issue was a React/Next.js application was not running.

Basically, you have to keep the application running in a separate window/terminal to be able to attach the debugger. This is unlike the other application where it starts from debug console itself.

like image 35
Rahul Avatar answered Oct 05 '22 18:10

Rahul


Try this:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "type": "dart"
        }
    ]
}
like image 23
Albert Avatar answered Oct 05 '22 18:10

Albert


I have seen a lot of solutions for this problem, but nothing worked.

After a little debugging and commenting out many parts of the code, I managed to locate the issue.

Basically, it occurs on the backend; not the frontend.

There was an infinite loop that kept responses stuck. Fixing that issue, solved it for me.

like image 43
Omar Dulaimi Avatar answered Oct 05 '22 17:10

Omar Dulaimi


I displayed a similar message in my debug console and the problem was that the local web server was turned off and therefore unreachable.

I turned on the server in the virtual machine and the app started working again :-)

like image 23
Pietro La Grotta Avatar answered Oct 05 '22 17:10

Pietro La Grotta


In my case, I had a Blazor solution and began receiving the "Crbug/1173575, non-JS module files deprecated message". Besides this, I also received a 404 error for the Index.html file!

The cause was that I inadvertently removed the reference in the .Server project to the .Client project. The project compiled fine without the reference, but I guess ASP.NET Core does some sort of reflection-based analysis on the dependencies to dynamically build the route map.

Restoring the reference to the .Client project on the .Server project fixed the problem.

like image 27
BlueStrat Avatar answered Oct 05 '22 19:10

BlueStrat


In my case, the problem was because port 4200 was taken by another application (Docker). As soon as I changed the port to 4201 by adding the next structure in the serve section of angular.json file the problem was solved.

"options": {
    "port": 4201
}
like image 36
Sergey Stativa Avatar answered Oct 05 '22 19:10

Sergey Stativa


My problem was in the network settings of my Windows 10 computer, not on the browser. I have tried my URL in another computer and mobile browsers, and it was working fine.

So, I have fixed the issue by resetting my network settings

To do that, go to SettingsNetwork and Internet → Scroll down to Network reset.

Wait for 5 minute until it restarts.

like image 29
Abdu Avatar answered Oct 05 '22 19:10

Abdu


I faced this issue while debugging in Visual Studio Code for an Angular application.

The probable causes may be the server is not up and listening to port. You may start the server manually by ng serve --port with port number. Also compare the URL in launch.json and compare the port number.

like image 25
Kumar Shanoo Avatar answered Oct 05 '22 18:10

Kumar Shanoo


In my case it was caused by uBlock Origin. Disabling it on the website promptly fixed the error.

like image 24
supersan Avatar answered Oct 05 '22 19:10

supersan


I think we should just remove the cookies in that URL:

Enter image description here

like image 23
tile Avatar answered Oct 05 '22 19:10

tile


I've tried many of the solutions suggested, and found someplace else this tip that was helpful:

I was unable to reach http://localhost:3000 from npm start run in a react app. So I tried: http://127.0.0.1:3000 and to my surprise it worked!

After some googling, I tried a suggestion to erase my browser cache, so I did it. All cached images and files (Google Chrome) and boom! It worked once again.

like image 1
Caio Cesar Avatar answered Oct 05 '22 19:10

Caio Cesar


To add another angle to this. I named my JavaScript modules with .mjs. After setting my web server to serve mjs with MIME type application/javascript. I got the error

'crbug/1173575, non-JS module files deprecated.'

None of the answers here helped. To fix it I gave a path to the module.

From

<script type="module" src="xxx.mjs"></script>

To

<script type="module" src="./xxx.mjs"></script>

And the error went away.

like image 1
Jerinaw Avatar answered Oct 05 '22 18:10

Jerinaw


I ran into this error on three separate Next.js projects. It was the same error in Chrome, Chrome Incognito, Firefox, and Edge.

It happened on a production build (next build && next start) and development server (next dev). After trying a number of fixes – ensuring I was on HTTP, not HTTPS, checking if the port was in use, deleting folder node_modules and running npm install, etc. – the thing that finally worked was restarting my computer...

like image 1
Peter Millspaugh Avatar answered Oct 05 '22 17:10

Peter Millspaugh


For aiohttp.

I've stumbled upon this issue with an aiohttp server. By default it was running on 0.0.0.0:8000 The solution was to change the host and the port to localhost:8080 in main.py file: web.run_app(app, host='localhost', port=8080)

like image 1
Roy O'Bannon Avatar answered Oct 05 '22 18:10

Roy O'Bannon