简体   繁体   English

Meteor-Angular2-ReferenceError:系统未定义

[英]Meteor-Angular2 - ReferenceError: System is not defined

Since I tried upgraded my project to support the last Angular2 router I completely broke my app.h 由于我尝试升级项目以支持最后一个Angular2路由器,所以我彻底破坏了我的app.h

Nothing went smoot and it's been an amazing journey through all errors and problems that I have face. 没有任何问题,这是经历了我所遇到的所有错误和问题的惊人旅程。 I managed to solve them all except this one. 除了这一项,我设法解决了所有这些问题。

I would be very appreciated if someone could give me a hint on what to do because I ran out of possibilities. 如果有人能给我一个提示,因为我用尽了所有的可能性,我将不胜感激。

W20160905-02:19:05.541(1)? (STDERR) /home/workspace/.meteor/packages/meteor-tool/.1.4.1_1.crqcrg++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20160905-02:19:05.652(1)? (STDERR)                             throw(ex);
W20160905-02:19:05.652(1)? (STDERR)                             ^
W20160905-02:19:05.653(1)? (STDERR)           
W20160905-02:19:05.653(1)? (STDERR) ReferenceError: System is not defined
W20160905-02:19:05.653(1)? (STDERR)     at systemjs.config.js:40:26
W20160905-02:19:05.654(1)? (STDERR)     at meteorInstall.systemjs.config.js (systemjs.config.js:5:1)
W20160905-02:19:05.654(1)? (STDERR)     at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160905-02:19:05.655(1)? (STDERR)     at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160905-02:19:05.655(1)? (STDERR)     at server/main.ts:11:4
W20160905-02:19:05.655(1)? (STDERR)     at /home/workspace/meteor-angular/test-app-v1.0.3/.meteor/local/build/programs/server/boot.js:292:10
W20160905-02:19:05.656(1)? (STDERR)     at Array.forEach (native)
W20160905-02:19:05.656(1)? (STDERR)     at Function._.each._.forEach (/home/workspace/.meteor/packages/meteor-tool/.1.4.1_1.crqcrg++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20160905-02:19:05.656(1)? (STDERR)     at /home/workspace/meteor-angular/test-app-v1.0.3/.meteor/local/build/programs/server/boot.js:128:5
=> Exited with code: 1

If your are trying to use lazy loading on routes like this: 如果您尝试在这样的路由上使用延迟加载:

{ path: "myPath", loadChildren: "app/myModule/myModule.module#MyModule"}

Sorry but it will not work as meteor doesn't support lazy loading. 抱歉,由于流星不支持延迟加载,因此无法使用。 Fortunately I managed to make it work with this: 幸运的是,我设法做到了这一点:

{path: "myPath", loadChildren: ()=> require('./myModule/myModule.module')["MyModule"] }

Hopefully will work for you as well. 希望也能为您服务。 :) :)

I'm just leaving here my solution, it may help someone else. 我将离开我的解决方案,这可能会对其他人有所帮助。

I wasn't able to find what was causing the problem, but I created a new meteor project, copied all the project files into it and installed the project dependencies with: 我找不到导致问题的原因,但是我创建了一个新的流星项目,将所有项目文件复制到其中,并使用以下命令安装了项目依赖项:

meteor npm install

Maybe it had something to do with a broken package. 也许与破损的包装有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM