Ошибка: Невозможно загрузить транспортер для перемещения после перехода от углового 5,2 к угловому 8 - PullRequest
0 голосов
/ 04 ноября 2019

Я обновил ASP.Net MVC с приложением Angular 5 с Angular 5.2 до 8.

И я выполнил шаги по переходу с сайта Angular .

* 1006. * Этот конкретный поток в StackOverflow упоминал решения для той же проблемы с Angular2, но ни один из них не работал в моем случае.

Пока все, что я выяснил, что проблема с SystemJSно до сих пор я не могу понять это.

Этот вопрос также описывает аналогичную проблему, но она также не помогла.

И мыя никогда не использовал пакет traceur, но почему-то я получаю сообщение об ошибке. Я проверил старый файл package.json, а также папку node_modules.

Кто-нибудь помогает с тем, что мне здесь не хватает? Я думаю, что что-то пропущено при обновлении, но не могу точно знать, что.

Package.config

{
  "name": "angular",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build -prod -aot -vc -cc -dop --buildOptimizer",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/build-optimizer": "^0.6.3",
    "@angular/animations": "^8.2.13",
    "@angular/common": "^8.2.13",
    "@angular/compiler": "^8.2.13",
    "@angular/core": "^8.2.13",
    "@angular/forms": "^8.2.13",
    "@angular/platform-browser": "^8.2.13",
    "@angular/platform-browser-dynamic": "^8.2.13",
    "@angular/router": "^8.2.13",
    "@ng-bootstrap/ng-bootstrap": "^5.1.2",
    "core-js": "^2.4.1",
    "rxjs": "^6.5.3",
    "systemjs": "0.19.40",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.16",
    "@angular/cli": "^8.3.16",
    "@angular/compiler-cli": "^8.2.13",
    "@angular/language-service": "^8.2.13",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^5.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~3.5.3",
    "webpack-bundle-analyzer": "^2.12.0"
  }
}

Systemjs.config.js

(function (global) {
  System.config({
    paths: {
      'npm:': 'node_modules/'
    },
    map: {
      'app': 'app',

      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
        '@ng-bootstrap/ng-bootstrap': 'node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js',
      '@angular/common/http': 'npm:@angular/common/bundles/common-http.umd.js',
      'tslib': 'npm:tslib/tslib.js',
      'rxjs':                      'npm:rxjs'
    },
    packages: {
      app: {
        defaultExtension: 'ts',
        meta: {
          './*.js': {
            loader: 'systemjs-angular-loader.js'
          }
        }
      },
      rxjs: {
        defaultExtension: 'js'
      }
    }
  });
})(this);

tsconfig.json

{
  "compileOnSave": true,
  "compilerOptions": {
    "downlevelIteration": true,
    "importHelpers": true,
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ],
    "module": "esnext",
    "removeComments": true,
    "baseUrl": "./"
  }
}

src / tsconfig.app.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "types": []
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "src/test.ts",
    "src/**/*.spec.ts"
  ]
}

Iя получаю эту ошибку в консоли.

(SystemJS) XHR error (404 Not Found) loading http://localhost:65309/traceur
    Error: XHR error (404 Not Found) loading http://localhost:65309/traceur
        at XMLHttpRequest.wrapFn (http://localhost:65309/node_modules/zone.js/dist/zone.js:1281:39)
        at ZoneDelegate.invokeTask (http://localhost:65309/node_modules/zone.js/dist/zone.js:423:31)
        at Zone.runTask (http://localhost:65309/node_modules/zone.js/dist/zone.js:195:47)
        at ZoneTask.invokeTask [as invoke] (http://localhost:65309/node_modules/zone.js/dist/zone.js:498:34)
        at invokeTask (http://localhost:65309/node_modules/zone.js/dist/zone.js:1693:14)
        at XMLHttpRequest.globalZoneAwareCallback (http://localhost:65309/node_modules/zone.js/dist/zone.js:1719:17)
    Error loading http://localhost:65309/traceur
    Unable to load transpiler to transpile http://localhost:65309/main.js
    Error loading http://localhost:65309/main.js
...