无法加载资源:Safari 9.1.2中的Observable.js.map

rva*_*iev 6 rxjs5 angular-cli angular2-observables angular

我在Angular-cli的Angular 2决赛中使用了observable.

  • Angular 2.0.0决赛
  • angular-cli:1.0.0-beta.15
  • 节点:6.3.0
  • Mac os:el capitan

package.json中的依赖项:

"dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "bootstrap-sass": "^3.3.7",
    "chart.js": "^2.2.2",
    "core-js": "^2.4.1",
    "d3": "^4.2.3",
    "d3-tip": "^0.7.1",
    "ionicons": "^3.0.0",
    "moment": "^2.15.1",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.23"
  }
Run Code Online (Sandbox Code Playgroud)

我的应用程序在Safari 9.1.2以外的每个浏览器中都能正常工作 - 它会将此错误消息抛出到控制台:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4200/Observable.js.map
Run Code Online (Sandbox Code Playgroud)

我试图在angular_cli.json中导入Rxjs:

"scripts": [
        "../node_modules/rxjs/Rx.js"
      ],
Run Code Online (Sandbox Code Playgroud)

另外,我试图将rxjs导入到app.module.ts和这样的工作组件:

import {Observable} from 'rxjs/Rx';
Run Code Online (Sandbox Code Playgroud)

但是继续得到同样的错误.

难道我做错了什么?很奇怪只有Safari遇到这个错误.

Yas*_*ary 0

请在 tsconfig.json 文件中将 sourceMap 标志从 false 更改为 True。

{
"compilerOptions": {
 ///////////////////////
    "sourceMap": true,
////////////////////////

}
Run Code Online (Sandbox Code Playgroud)

因为我遇到了同样的问题,之后我工作得很好:)