2016-08-23 27 views
0

当使用Angular 2 RC.5的默认SystemJS配置时,lite服务器抛出错误如果将redux作为依赖关系添加,则未定义进程。有没有人经历过这个?下面是跟踪堆栈:过程未在lite服务器中用redux进行定义

(index):43 Error: ReferenceError: process is not defined at Object.eval (http://localhost:3000/node_modules/redux/lib/index.js:38:5) at eval (http://localhost:3000/node_modules/redux/lib/index.js:47:4) at eval (http://localhost:3000/node_modules/redux/lib/index.js:48:3) at Object.eval (http://localhost:3000/node_modules/ng2-redux/lib/components/ng-redux.js:14:15) Evaluating http://localhost:3000/node_modules/redux/lib/index.js Evaluating http://localhost:3000/node_modules/ng2-redux/lib/components/ng-redux.js Evaluating http://localhost:3000/node_modules/ng2-redux/lib/index.js Evaluating http://localhost:3000/actions/session.actions.js Evaluating http://localhost:3000/app/app.component.js Evaluating http://localhost:3000/app/app.module.js Evaluating http://localhost:3000/app/main.js Error loading http://localhost:3000/app/main.js

+0

你能分享你的system.config.js吗? –

回答

3

对于堆栈溢出记录,重复我对GitHub上同一问题的回答:https://github.com/angular-redux/ng2-redux/issues/202

尝试把这个在system.config.js:

var map = { 
    /* ... */ 
    'ng2-redux': 'node_modules/ng2-redux', 
    'redux':  'node_modules/redux', 
}; 

var packages = { 
    /* ... */ 
    'ng2-redux': { main: 'lib/index.js', defaultExtension: 'js' }, 
    'redux':  { main: 'dist/redux.js', defaultExtension: 'js' }, 
}; 
+0

这解决了这个问题。 –