2016-09-01 25 views
1

rc5プロジェクトをrc6に更新しています。私がプロジェクトに奉仕するとき、私はError: ReferenceError: $traceurRuntime is not definedを得ています。私は何が間違っているのか分からない。

(function (global) { 
    var map = { 
    'app': 'app' 
    }; 
    var packages = { 
    'app': { main: 'main.js', defaultExtension: 'js' }, 
    'rxjs': { defaultExtension: 'js' }, 
    }; 
    var ngPackageNames = [ 
    'common', 
    'compiler', 
    'core', 
    'forms', 
    'http', 
    'platform-browser', 
    'platform-browser-dynamic', 
    'router' 
    ]; 
    // Add package entries for angular packages 
    ngPackageNames.forEach(function packIndex(pkgName) { 
    packages['@angular/' + pkgName] = { main: 'index.js', defaultExtension: 'js' }; 
    }); 

    System.config({ 
    defaultJSExtensions: true, 
    map: map, 
    packages: packages 
    }); 
})(this); 

のindex.htmlを次のように:私のsystem.config.jsは、次のようになります

<!DOCTYPE html> 
<html lang="en"> 

<head> 
    <base href="/"> 
    <title>Angular2 rc6</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 

    <link rel="stylesheet" type="text/css" href="../node_modules/bootstrap/dist/css/bootstrap.min.css" /> 
    <!-- endbuild --> 

    <!-- build:js lib/core.js --> 
    <script src="../node_modules/core-js/client/shim.min.js"></script> 
    <script src="../node_modules/zone.js/dist/zone.js"></script> 
    <script src="../node_modules/reflect-metadata/Reflect.js"></script> 
    <script src="../node_modules/systemjs/dist/system.src.js"></script> 
    <!-- endbuild --> 
    <!-- dependencies --> 
    <script src="lib/dependencies.bundle.js"></script> 

    <!-- build:js lib/dependencies.bundle.js 
    <script src="../node_modules/rxjs/bundles/Rx.js"></script> 
    <script src="../node_modules/@angular/common/bundles/common.umd.js"></script> 
    <script src="../node_modules/@angular/compiler/bundles/compiler.umd.js"></script> 
    <script src="../node_modules/@angular/core/bundles/core.umd.js"></script> 
    <script src="../node_modules/@angular/forms/bundles/forms.umd.js"></script> 
    <script src="../node_modules/@angular/http/bundles/http.umd.js"></script> 
    <script src="../node_modules/@angular/platform-browser/bundles/platform-browser.umd.js"></script> 
    <script src="../node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js"></script> 
    <script src="../node_modules/@angular/router/bundles/router.umd.js"></script> 
    --> 
    <!-- endbuild --> 

    <!-- 2. Configure SystemJS --> 
    <script src="systemjs.config.js"></script> 
    <script> 
    System.import('app/main').catch(function(err){ console.error(err); }); 
    </script> 
</head> 

<body> 
    <app>Loading...</app> 
</body> 

</html> 

を私はこれが問題であると仮定し、関連systemjsが、私は本当に間違ってやっているかを把握することはできません何とかです?

編集: 私は問題が依存関係バンドルのために生成しているdependencies.bundle.jsにあることを発見しました。

System.register("@angular/http/src/static_request.js", ["@angular/http/src/facade/lang.js", "@angular/http/src/body.js", "@angular/http/src/enums.js", "@angular/http/src/headers.js", "@angular/http/src/http_utils.js", "@angular/http/src/url_search_params.js"], function($__export) { 
     "use strict"; 
... 
w = (typeof window === 'undefined' ? 'undefined' : $traceurRuntime.typeof(window)) == 'object' ? window : noop; 
+0

参照[ES6モジュールに関する重大な変更](https://github.com/angular/angular/blob/master/CHANGELOG.md#breaking-changes)。 – estus

答えて

5

RC6では、SystemJSを使ってAngularをロードする場合、UMDバンドルを使用する必要があるようです。

Changelog

npm packages: code in ESM (ES6 Modules) format is now published at the default location in the npm package with package.json's main entry pointing to an UMD bundle (primarily for node, and webpack 1 users).

If you are using SystemJS to load Angular, you should adjust your SystemJS configuration to point to the UMD bundles (present in the npm package).

Please see this example SystemJS config .

から私はSystemJS Builderを使用していますし、この変更は、私が整理する必要があるいくつかの深刻な問題を与えています。私systemjsへ

transpiler: false

が私のために、この問題を解決しCONFIG:

+0

こんにちはKriskit、あなたの返信をありがとうございました。私はsystemjs-builder 0.15.25も使用しています。修正を見つけたら教えてください。 – user3506588

+0

この問題に関するニュースはありますか? – Loves2Develop

関連する問題