We are working on a web app using angular 8. When we are on the page of a certain component and we press ctrl f5 or refresh from browser, we get white page and this list of error:
from the "unchaught syntaxError: unexpected token '<' " we understood that the browser is trying to load a script but gets a .html file insted. The problem is that inside our index.html file, every single script is commented and there is no "scripts.js". How can i solve/what is the possible problem?
CodePudding user response:
Try using use hash routing configuration
routerModule.forRoot(routes, { useHash: true })
Angular will start handling the redirections himself, instead of deffering it to the server.
Right now your issue is that the server has to handle the redirections, and tons of different errors can happen when it's not set up properly.