流星路由错误:该路径没有路由:/ [英] Meteor Routing Error : There is no route for the path: /

查看:122
本文介绍了流星路由错误:该路径没有路由:/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Meteor更新为Meteor 1.3.2.4.并面对这个问题.我还更新了所有软件包的最新版本.

I have updated Meteor to Meteor 1.3.2.4. and facing the issue. I have also updated all the packages in their latest version.

错误:该路径没有路由:/

我在"流星"和"流星运行-生产"这两个环境中都尝试了这两种情况,控制台中将显示相同的错误.

I tried the both in both environment "meteor" and "meteor run --production" the same error will displayed in console.

我已经安装了以下软件包.

I have installed the following packages.

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是 暴露= FlowRouter.group();

My routing.js is exposed = FlowRouter.group();

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"});
    }
});

推荐答案

我遇到了这个问题,并通过消除开发版本中存在的控制台错误来解决此问题.

I had this problem, and fixed it by getting rid of console errors that were present in the development build.

认为我的开发版本可以正常运行,但生产版本无法正常运行的原因是,由于JS文件被串联用于生产,这意味着该错误阻止了后续代码的运行.

Think the reason my development build was working, but production build wasn't, is because of JS files being concatenated for production, meaning that this error was preventing subsequent code from running.

因此,座右铭是确保没有引发任何错误,因为在连接生产文件时会导致更多问题!

(有问题的程序包是autoform-hint,但认为这不是特别有用.)

(The package in question was autoform-hint, but don't think that is particularly relevant.)

这篇关于流星路由错误:该路径没有路由:/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆