Ошибка маршрутизации метеора: нет маршрута для пути: /

Я обновил Meteor до Meteor 1.3.2.4. и столкнулся с проблемой. Я также обновил все пакеты до последней версии.

Ошибка: нет маршрута для пути: /

Я пробовал оба в обеих средах "meteor" и "meteor run --production", в консоли будет отображаться одна и та же ошибка.

Я установил следующие пакеты.

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();

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

person Manoj Kumar    schedule 25.04.2016    source источник
comment
вы import свой файл routing.js в файле main.js вашего клиента?   -  person Faysal Ahmed    schedule 25.04.2016
comment
Как импортировать в main.js я не знал.   -  person Manoj Kumar    schedule 25.04.2016
comment
если вы не знакомы с модулем импорта/экспорта, я настоятельно рекомендую вам использовать метеор версии 1.2. вы сможете делать вещи намного быстрее. Или вы можете сначала изучить ecmascript2015+.   -  person Faysal Ahmed    schedule 25.04.2016
comment
@FaysalAhmed Я также пробовал 1.2.1 в другой моей системе. Но столкнулся с проблемой Нет маршрута для пути: / при использовании метеора --production   -  person Manoj Kumar    schedule 25.04.2016
comment
Эта проблема решена: я только что переместил файл routing.js в lib/routing.js, теперь он работает, как и ожидалось.   -  person Manoj Kumar    schedule 27.04.2016
comment
В моем случае я удалил пакет dopzone и установил его с помощью meteor npm install --save dropzone, после чего эта проблема была решена. Попробуйте удалить пакет один за другим и проверьте, какой пакет вызывает эту проблему.   -  person Tushar Kale    schedule 08.06.2020


Ответы (1)


У меня была эта проблема, и я исправил ее, избавившись от ошибок консоли, которые присутствовали в сборке разработки.

Думаю, причина, по которой моя сборка для разработки работала, а рабочая сборка — нет, заключается в том, что файлы JS были объединены для производства, а это означает, что эта ошибка препятствовала запуску последующего кода.

Итак, девиз: следите за тем, чтобы не возникало ошибок, так как они приведут к большему количеству проблем при объединении файлов для производства!

(Рассматриваемый пакет был autoform-hint, но не думаю, что это особенно важно.)

person Richard Sands    schedule 29.02.2020