While executing ng build --prod --base-href ./ for building my cordova app, the final output throws an error as below.
Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
I did end up fixing this by changing type module to text/javascript
src="runtime-es2015.858f8dd898b75fe86926.js" type="module">
src="runtime-es2015.858f8dd898b75fe86926.js" type="text/javascript">
Is there something that can be done within angular.json file to fix or am I missing out something here?
I had the same issue.
Built a production version
"build-production": "ng build --configuration=production --extract-css=false --prod --aot"
Deployed to NGINX
Fix
Update tsconfig.json
"target": "es5",
Then rebuild the application and deploy again.
This solution worked for me, I now have content in my deployed app.
Hope it helps somebody
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With