:4200//assets/config.json:1 Failed to load resource: the server responded with a status of 404 (Not Found)

702 Views Asked by At

Using VS code angular 14

Project was updated from angular 8

ng build and ng serve works fine.

But http://localhost:4200/ give this error: Failed to load resource: the server responded with a status of 404 (Not Found) :4200//assets/config.json:1

And I stuck here.

enter image description here

enter image description here

1

There are 1 best solutions below

0
Marc On

In the file configuration.service.ts there is this

private get configurationUrl(): string { 
const path = (environment.configurationPath.startsWith('/') ? '' : '/') + environment.configurationPath; const baseUrl = this.window.document.baseURI; return ${baseUrl}${path}; 
}

I changed the first line because it is adding a backslash for I don’t know what reason.

private get configurationUrl(): string { 
const path = environment.configurationPath; const baseUrl = this.window.document.baseURI; return ${baseUrl}${path}; 
} 

And this solve the issue. So thank you all for your help, it made me think to look for this double backslash