I am trying to run Angular 2 UI technology with spring MVC on a single server. When I integrated it(copied the content of Dist folder to Webapp) It loads index.html from angular but gives error for scripts like polyfills.js:, runtime.js, main scripts saying "Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec." Spring version used - 6.1.4, tomcat- 10.1

Added is servlet.xml and added index.html at "WEB-INF/pages/" location. But all this polyfills, main, runtime.js are outside WEB-INF in webapp.

Also removed subdirectory from angular.json

I have tried changing to "./" and trying multiple path for scripts but of no use. Tried changing project structure yet nothing helped. Thanks in advance.

0

There are 0 best solutions below