Loading failed after ionic serve

Hello,

I got the error “loading failed for scipt http://localhost:8100/build/main.js” in browser after run command ionic serve.
When I click on the error it jumps to index.html to
<script src="build/main.js"></script>.

When I run the command ionic build I get the error Could not resolve ‘./polyfills.ts’ from src\app\main.ts.

Please help.

What is your ionic info output?
Did you app work before?
Does it work with a new blank app created with ionic start blank blank?

cli packages

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

local packages:

@ionic/app-scripts : 2.1.4
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v6.10.1
npm  : 4.2.0
OS   : Windows 7

The app works before my update, I updated the ionic and angular versions.

Show us your new package.json then please.
Also run ionic serve --verbose and post the whole output.

Output from ionic serve --verbose

C:\XXX>ionic serve --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\XXX', local: false, binPath:
        'C:\\Users\\XXX\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Users\\XXX\\AppData\\Roaming\\npm\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Daemon found (pid: 11000)
[INFO] Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 - Ctrl+C to cancel
[13:45:43]  watch started ...
[13:45:43]  build dev started ...
[13:45:43]  clean started ...
[13:45:43]  clean finished in less than 1 ms
[13:45:43]  copy started ...
[13:45:43]  transpile started ...
[13:45:46]  transpile finished in 3.76 s
[13:45:46]  preprocess started ...
[13:45:46]  deeplinks started ...
[13:45:47]  deeplinks finished in 78 ms
[13:45:47]  preprocess finished in 94 ms
[13:45:47]  rollup started ...
[13:45:47]  copy finished in 3.99 s
[13:45:47]  dev server running: http://localhost:8100/

[INFO] Development server running
       Local: http://localhost:8100
[13:45:47]  watch ready in 4.24 s

package.json

{
  "name": "MyApp",
  "config": {
    "ionic_rollup": "src/config/rollup.config.js"
  },
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "^4.3.6",
    "@angular/compiler": "^4.3.6",
    "@angular/compiler-cli": "^4.3.6",
    "@angular/core": "^4.3.6",
    "@angular/forms": "^4.3.6",
    "@angular/http": "^4.3.6",
    "@angular/platform-browser": "^4.3.6",
    "@angular/platform-browser-dynamic": "^4.3.6",
    "@angular/platform-server": "^4.3.6",
    "@ionic/storage": "^2.0.1",
    "@types/lodash": "^4.14.42",
    "angular2-cookie": "^1.2.5",
    "d3-ng2-service": "^1.5.2",
    "ionic-angular": "^3.6.0",
    "ionic-native": "^2.4.0",
    "ionicons": "^3.0.0",
    "lodash": "^4.17.2",
    "ng2-translate": "^5.0.0",
    "rxjs": "^5.0.0-beta.12",
    "zone.js": "^0.8.17"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^2.1.4",
    "rollup-plugin-replace": "^1.1.1",
    "sw-toolbox": "^3.4.0",
    "typescript": "2.3.4"
  },
  "description": "To see deep in the sea",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}

Ionic doesn’t support Angular 4.3.x yet.

See here for the most recent supported versions of everything:

You can also create a new project with ionic start blank blank and compare that to your project.

I adapt the versions.
I still got the error
The ressourcce “http://localhost:8100/build/main.css” is blocked due to MIME-Typ-Conflict(X-Content-Type-Options: nosniff).
The main.js, main.css is still not not created.