Meteor-Angular2 - ReferenceError: System is not defined

雨燕双飞 提交于 2019-12-12 03:33:23

问题


Since I tried upgraded my project to support the last Angular2 router I completely broke my 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

回答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. :)




回答2:


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.



来源:https://stackoverflow.com/questions/39323084/meteor-angular2-referenceerror-system-is-not-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!