I have an Angular 6 application with a component called assets. When I navigate to the component through routerLinks, the page load and shows data as expected:
http://localhost:4200/assets/2
However if I refresh the page, or just load the link directly in a browser then a lot of my scripts fail to load:
GET http://localhost:4200/assets/runtime.js net::ERR_ABORTED 404 (Not Found)
Refused to execute script from '<URL>' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
GET http://localhost:4200/assets/polyfills.js net::ERR_ABORTED 404 (Not Found)
Do I need to do something in the router or what's causing this?