• Register
0 votes

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 :


Now to remove first registration you can use below command:


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
2 answers 2.1K 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 3.6K views
Problem: I am currently wondering why I am getting below compile error if I just declare variable with var or let keywords? I want to say, below code goes well: export class MyAppComponent { myRefreshClickStream$: any; constructor(){ } } While this brings the error: export class MyAppComponent { var myRefreshClickStream$: any; constructor(){ } }
asked Jan 27, 2020 jwilliam 3.9k points
0 votes
1 answer 219 views
Problem : I am beginner to Angular 2. Currently I am trying to learn more about the server rendering with the help of Angular2, I am trying to use the gulp instead of webpack. But my problem is when my server starts then I start facing below error : /Users/mphil ... using class decorators I have also tried some solutions mentioned online but they are not working on my code. How can I fix my code ?
asked Feb 25, 2020 mphil 2.3k points
0 votes
1 answer 5 views
Problem: However when I am trying to access the URL through browser there is no problem , but when I try to access it through a java program, it throws expection: java.io.IOException: Server returned HTTP response code: 403 for URL What is the solution?
asked Feb 19 Ali 4.8k points
0 votes
1 answer 11 views
Can anyone help me to find out the issue? Where is the problem with the server?
asked Feb 12 TeamScript 13.5k points
0 votes
1 answer 9 views
What's wrong? Did the host block me?
asked Jan 3 TeamScript 13.5k points
0 votes
1 answer 981 views
Problem: I am facing following error if I tried to use a MatToolBar in my angular app. In browser I receive: Uncaught TypeError: Object(...) is not a function I also receive below warnings in my console: WARNING in ./node_modules/@angular/cdk/esm5/text-field.es5.js ... /cdk/esm5/a11y.es5.js 2324:206-214 "export 'ɵɵinject' was not found in '@angular/core' Kindly guide me in resolving above errors.
asked Aug 18, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 6 views
Problem : Cannot read property 'thisCompilation' of undefined in Visual Code
asked 4 days ago Shovo210 2.9k points
0 votes
1 answer 3K views
Problem : I am facing following error from the Angular 2 core.umd.js:5995 EXCEPTION: Uncaught (in promise): Error: Error in app/model_exposure_currencies/model_exposure_currencies.component.html:57:18 caused by: If ngModel is used within a form tag, either the name attribute must be set or the form ... 0-9]+)?" required> </div> </td> Below is my form tag: <form #f="ngForm" (ngSubmit)="onSubmit()">
asked Dec 3, 2019 alecxe 7.5k points