2

I tried to publish my Angular 8 Web build into the server. The build made successfully. But it starts to show error after publishing in Server. I will list the error below.

Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

I will add a screenshot of the image as well

enter image description here I will add my config.xml file here

{
    "name": "Project",
    "version": "0.0.0",
    "scripts": {
        "ng": "ng",
        "start": "ng serve",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
    },
    "private": true,
    "dependencies": {
        "@angular/animations": "^8.2.14",
        "@angular/cdk": "^8.2.3",
        "@angular/common": "^8.2.14",
        "@angular/compiler": "^8.2.14",
        "@angular/core": "^8.2.14",
        "@angular/flex-layout": "^8.0.0-beta.27",
        "@angular/forms": "^8.2.14",
        "@angular/material": "^8.2.3",
        "@angular/platform-browser": "^8.2.14",
        "@angular/platform-browser-dynamic": "^8.2.14",
        "@angular/router": "^8.2.14",
        "bootstrap": "^4.4.1",
        "core-js": "^2.6.11",
        "flag-icon-css": "^3.4.6",
        "hammerjs": "^2.0.8",
        "jquery": "^3.4.1",
        "ng-animate-scroll": "^7.1.0",
        "ng2-opd-popup": "^1.1.21",
        "rxjs": "^6.5.4",
        "tslib": "^1.10.0",
        "zone.js": "~0.9.1"
    },
    "devDependencies": {
        "@angular-devkit/build-angular": "^0.800.6",
        "@angular/cli": "^8.3.24",
        "@angular/compiler-cli": "^8.2.14",
        "@angular/language-service": "^8.2.14",
        "@types/jasmine": "~2.8.8",
        "@types/jasminewd2": "^2.0.8",
        "@types/node": "^8.10.59",
        "codelyzer": "^5.2.1",
        "jasmine-core": "~2.99.1",
        "jasmine-spec-reporter": "~4.2.1",
        "karma": "~4.0.0",
        "karma-chrome-launcher": "~2.2.0",
        "karma-coverage-istanbul-reporter": "^2.1.1",
        "karma-jasmine": "~1.1.2",
        "karma-jasmine-html-reporter": "^0.2.2",
        "protractor": "^5.4.3",
        "ts-node": "~7.0.0",
        "tslint": "~5.11.0",
        "typescript": "~3.4.5"
    }
}
Carsten
  • 4,005
  • 21
  • 28
Kevin Jose
  • 856
  • 8
  • 22

1 Answers1

-1

The simple solution is to create a new ionic project using ionic start command. Copy your src directory and package.json file. And just give npm install. Once again add platforms and make sure you have index.html file inside www folder.

סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
user13688383
  • 79
  • 2
  • 1