Javascript 流星路由错误:路径没有路由:/
我已将Meteor更新为Meteor 1.3.2.4。面对这个问题。我还更新了所有软件包的最新版本 错误:路径没有路由:// 我在环境“meteor”和“meteor run--production”中尝试了这两种方法,控制台中将显示相同的错误 我已经安装了以下软件包Javascript 流星路由错误:路径没有路由:/,javascript,node.js,meteor,flow-router,Javascript,Node.js,Meteor,Flow Router,我已将Meteor更新为Meteor 1.3.2.4。面对这个问题。我还更新了所有软件包的最新版本 错误:路径没有路由:// 我在环境“meteor”和“meteor run--production”中尝试了这两种方法,控制台中将显示相同的错误 我已经安装了以下软件包 accounts-oauth 1.1.12 Common code for OAuth-based login services accounts-password
accounts-oauth 1.1.12 Common code for OAuth-based login services
accounts-password 1.1.8 Password support for accounts
autopublish 1.0.7 (For prototyping only) Publish the entire database to all clients
blaze-html-templates 1.0.4 Compile HTML templates into reactive UI with Meteor Blaze
cfs:gridfs 0.0.33 GridFS storage adapter for CollectionFS
cfs:standard-packages 0.5.9 Filesystem for Meteor, collectionFS
ecmascript 0.4.3 Compiler plugin that supports ES2015+ in all .js files
email 1.0.12 Send email messages
es5-shim 4.5.10 Shims and polyfills to improve ECMAScript 5 support
flowkey:bootstrap-tour 1.1.0 A Meteor.js / Blaze integration for bootstrap-tour
insecure 1.0.7 (For prototyping only) Allow all database writes from the client
jquery 1.11.8 Manipulate the DOM using CSS selectors
kadira:blaze-layout 2.3.0 Layout Manager for Blaze (works well with FlowRouter)
kadira:flow-router 2.12.1 Carefully Designed Client Side Router for Meteor
meteor-base 1.0.4 Packages that every Meteor app needs
mobile-experience 1.0.4 Packages for a great mobile user experience
mongo 1.1.7 Adaptor for using MongoDB and Minimongo over DDP
pauli:accounts-linkedin 1.3.1 Accounts service for LinkedIn accounts
service-configuration 1.0.9 Manage the configuration for third-party services
session 1.1.5 Session variable
standard-minifier-css 1.0.6 Standard css minifier used with Meteor apps by default.
standard-minifier-js 1.0.6 Standard javascript minifiers used with Meteor apps by default.
themeteorchef:jquery-validation 1.14.0 jQuery Validation by jzaefferer, repackaged for Meteor.
tomi:upload-jquery 2.4.0 Client template for uploads using "jquery-file-upload" from blueimp
tomi:upload-server 1.3.4 Upload server for Meteor. Allows to save and serve files from arbitrary directory
tracker 1.0.13 Dependency tracker to allow reactive callbacks
u2622:persistent-session 0.4.4 Persistently store Session data on the client
zimme:active-route 2.3.2 Active route helpers
我的routing.js是
exposed=FlowRouter.group()
我遇到了这个问题,并通过消除开发构建中出现的控制台错误来修复它 我认为我的开发构建可以正常工作,而生产构建不能正常工作,是因为JS文件被连接到生产环境中,这意味着这个错误阻止了后续代码的运行 所以,格言是,确保不会抛出错误,因为在连接文件进行生产时,这些错误会导致更多问题强>
(所讨论的包是autoform提示,但不认为这是特别相关的。)您是否在客户端的
main.js
文件中导入了routing.js
文件?我不知道如何导入main.js。如果您不熟悉导入/导出模块,我强烈建议您使用meteor 1.2版。你将能够很快地完成事情。或者您可以先学习ecmascript2015+。@FaysalAhmed我也在我的另一个系统上试用了1.2.1。但是,当使用“meteor--production”时,面对“路径没有路由:/”的问题,这个问题得到了解决:我刚刚将routing.js移到了“lib/routing.js”中,现在它可以正常工作了。
exposed.route('/', {
triggersEnter: function () {
if (Meteor.loggingIn() && typeof Meteor.userId() !== 'undefined') {
FlowRouter.go("/dashboard");
}
},
action: function () {
BlazeLayout.render("mainTemplate", {content: "homePage"});
}
});
exposed.route('/login', {
triggersEnter: function () {
if (Meteor.userId() !== null) {
FlowRouter.go("/dashboard");
}
},
action: function (params) {
BlazeLayout.render("mainTemplate", {content: "login"});
}
});