0
Hello,
When deploying my application to a server Tomcat 8.5 css and js files imported into angular json. are not loaded. locally works correctly
Remarks:
This server has a link to external access, when I access the application by passing the server IP in the url the css and js are loaded, but with the external access link the Css and js are not loaded.
I use the base href="/Projeto"
, and in the angular.json
define the paths as follows :
"node_modules/primeicons/primeicons.css",
"src/styles.css",
"node_modules/owl.carousel/dist/assets/owl.carousel.min.css",
"node_modules/owl.carousel/dist/assets/owl.theme.default.min.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/bootstrap3/bootstrap3.min.css",
"node_modules/font-awesome/css/font-awesome.css",
"node_modules/primeng/resources/primeng.css",
"node_modules/primeng/resources/themes/nova-light/theme.css"
I’ve already tried:
Build the project with config --extract-css=false
and I’ve also changed this attribute to false in angular.json
Remarks 2:
When inspecting the page it was possible to see that the file happens an error
Failed to load resource: net::ERR_CONNECTION_RESET
And this error indicates that it was in styles.e7efefb7ef5355459826.js:1
I did the production build, and reinforcing, this error only happens by accessing the external link to my server
You built production or development?
– Costamilam
Oi Guilherme, I did the production build
– Lucio Leandro
Look, I’ve seen difficulty like this to visualize formatting in production and why amazing it seems the problem was the browser cache. Cache, cookies, and history. I cleaned up and went.
– Fabiano Monteiro
Thanks Fabiano, I did the test, it was not that, I also tried different browsers and different machines, remembering that this error happens when I access the external link of the server
– Lucio Leandro