我正在尝试在本地运行 ReactJS + CoffeeScript 应用程序,页面似乎在 JS 中加载,但没有显示任何内容(空白屏幕),控制台中显示错误
未捕获的 ReferenceError:未定义通量
这是似乎引起错误的代码片段。我们将 Flux 作为应用程序中节点模块的一部分。我看不出我应该在这里做什么。
请指导。
dispatcher = new Flux.Dispatcher();
module.exports = dispatcher;
},{}],5:[function(require,module,exports){
var Auth, LoggedInMixin, isEarlyPage, user;
Auth = require('./auth.coffee');
user = require('./stores/user.coffee');
isEarlyPage = function(path) {
return path.substr(1, 5) === 'early' || path.substr(1, 8) === 'settings';
};
module.exports = LoggedInMixin = {
statics: {
willTransitionTo: function(transition) {
if (!user.isLoggedIn()) {
console.error("User not logged in, redirecting.");
return Auth.redirect(transition);
}
if (!user.hasAccess() && !isEarlyPage(transition.path)) {
console.error("User does not have early access, redirecting.");
return transition.redirect('early');
}
}
}
};
},{"./auth.coffee":2,"./stores/user.coffee":11}],6:[function(require,module,exports){
var Constants, Nav, dispatcher, stores;
Constants = require('./constants.coffee');
Nav = require('./views/nav.cjsx');
dispatcher = require('./dispatcher.coffee');