• Register
0 votes
359 views

Problem :

I am beginner to Angular. I have recently started to use the ng serve but now I continuously get below error.

“A bad http response code (404) was received when fetching the script.

I have already tried to do lot of research on it but still I don’t have any solution on it.

Can somebody help me in resolving the errors ?

8 4 2
2,300 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I had also faced such error very recently. I can help you in fixing above error.

Let me tell you the reason behind this error is the pending subscription to your service worker for which your current application may be don’t have the source code (so you are facing 404).

So it clearly means that it is not related to your page fault.

I know that red lines are very annoying when you are stuck with it.

A very simple solution is to just unsubscribe by hand from a browser inspect page console:

So just to have the look at how many registrations are there you can use below command :

navigator.serviceWorker.getRegistrations();

Now to remove first registration you can use below command:

navigator.serviceWorker.getRegistrations().then((r)=>{r[0].unregister()})

I know my above solution will fix your errors and you can start working on your angular code.

5 2 1
4,980 points

Related questions

0 votes
1 answer 14 views
14 views
Problem: Please help me to solve the response had http status code 404
asked Mar 18 Ifra 36.4k points
0 votes
1 answer 8 views
8 views
Problem: I’m getting this error the response for preflight has invalid http status code 404. Kindly help ..!
asked Mar 6 Umar Ahmad 4.1k points
0 votes
1 answer 5 views
5 views
Problem: I'm using VueJS and Laravel for my project. This issue started to show lately and it shows even in the old git branches. This error only shows in Chrome browser.
asked Apr 26 ochena 23.3k points
0 votes
2 answers 2.6K views
2.6K views
Problem : Currently I am using VueJS and Laravel for the project. Following issue started to show lately and it also comes up even in the old git branches. Unchecked runtime.lasterror: the message port closed before a response was received. This error only comes up in Chrome browser.
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 2 views
2 views
Problem: I need to install apache so I can access to the projects in localhost? I do not remeember if I had apache installed in my old pc wheer I could access to teh app. I did netstat -ano | findstr 8080 in cmd and found in task manager that port 8080 is used by java.exe. Maybe it is a port issue? Thanks!
asked 6 days ago Humaira ahmed 50.7k points
0 votes
1 answer 3 views
3 views
Problem: I have jailbroken device using Absinthe, 2 days back I removed the jailbreak. Now I am not able to connect my iPhone 4 to iTunes. It says "iTunes could not connect to the iPhone because an invalid response was received from the device".
asked Apr 24 ummeshani 9.5k points
0 votes
1 answer 7 views
7 views
Problem: I am not able to connect my iPhone 4 to iTunes. It says "iTunes could not connect to the iPhone because an invalid response was received from the device". I have tried it on another system and also changed the cable. The problem is as it is. Anybody, please help me?
asked Apr 22 ummeshani 9.5k points
0 votes
1 answer 4 views
4 views
Problem: I am not able to connect my iPhone 4 to iTunes. It says "iTunes could not connect to the iPhone because an invalid response was received from the device
asked Apr 9 ummesalma 29.2k points
1 vote
1 answer 4 views
4 views
Problem: How to fix this error : itunes invalid response was received from the device
asked Apr 8 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 4 views
4 views
Problem: I need assistance in resolving this problem: itunes could not connect to the iphone because an invalid response was received from the device.
asked Apr 7 rakib1 51.5k points