2016-09-01 4 views
1

rc5 프로젝트를 rc6으로 업데이트 중입니다. 프로젝트를 진행할 때 나는 Error: ReferenceError: $traceurRuntime is not defined을 얻고 있습니다. 나는 무엇이 잘못되었는지조차 모른다. 다음과 같이 index.html을

(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); 

:

<!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입니다 가정,하지만 난 정말 잘못하고있는 무슨 알아낼 수 없습니다 다음과 같은 내 system.config.js 보인다 ?

편집 : 문제점이 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를 사용하여 각도를로드하는 경우 이제 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 빌더를 사용하고 있는데,이 변화는 나에게 내가 밖으로 정렬해야 할 몇 가지 심각한 문제를 주었다. 내 systemjs에

transpiler: false

나를 위해이 문제를 해결 구성 :

+0

안녕하세요. Kriskit, 답장을 보내 주셔서 대단히 감사합니다. systemjs-builder 0.15.25도 사용합니다. 수정 사항을 찾으면 알려주십시오. – user3506588

+0

이 호에 관한 뉴스가 있습니까? – Loves2Develop

관련 문제