2017-08-29 36 views
-2

我創造angular2 +社區的公共推廣和演示不需額外運行方式espected,也許是我做錯了什麼,錯誤的是:SystemJS不工作

Fetch error: 404 Not Found 
Instantiating http://localhost:3000/typescript 
Loading typescript 
Unable to load transpiler to transpile http://localhost:3000/demo/main.ts 
Instantiating http://localhost:3000/demo/main.ts 
Loading demo 
at system.js:4 
at ZoneDelegate.invoke (zone.js:392) 
at Zone.run (zone.js:142) 
at zone.js:844 
at ZoneDelegate.invokeTask (zone.js:425) 
at Zone.runTask (zone.js:192) 
at drainMicroTaskQueue (zone.js:602) 
at <anonymous> 

乘坐時間看到Github上的代碼,我更新了問題,所以任何人都可以幫助我?

感謝您的時間。

回答

0

你可能有一個多-評論,該評論中,你可能有一個import語句

比較這:https://github.com/angular/angular/issues/12967

/* import { CrisisListComponent } from './crisis-list.component'; 
    import { HeroListComponent } from './hero-list.component'; */ 

System.JS使用正則表達式查找導入 - 聲明並由此會發現他們即使在註釋掉的代碼塊

要解決此問題,註釋掉每個進口語句行註釋

//import { CrisisListComponent } from './crisis-list.component'; 
//import { HeroListComponent } from './hero-list.component'; 

除此之外,你可能想谷歌 「無法加載transpiler到transpile」,因爲那是你的問題的根本原因

+0

已歷經看着它,我的代碼爲多行註釋,但沒有進口,刪除註釋和相同的錯誤發生,因爲我賽義德,媒體鏈接tryed很多的提示... –

0

想通了,這個問題是與打字稿地圖,我增加了一個手動的typescript.js映射,如下面的核心描述,並沒有給出任何更多的錯誤,謝謝你的時間。

map: { 
    // our app is within the app folder 
    'app': 'app', 
    // angular bundles 
    '@angular/core': 'npm:@angular/core/bundles/core.umd.js', 
    '@angular/common': 'npm:@angular/common/bundles/common.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/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', 
    '@angular/router': 'npm:@angular/router/bundles/router.umd.js', 
    // other libraries 
    'rxjs': 'npm:rxjs', 
    'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api', 

    'typescript': 'npm:typescript/lib/typescript.js' 
},