Open ManojBitx opened 8 years ago
Yes. I have got same error.
@vmusulainen I moved my routing.js to "lib/routing.js" Now it working fine. Please try this.
Yes, I agree all work fine if the route for "/" is set in a file and this file can be found. But I faced with this error just after adding flow-iron package to my app. I have no any import "flow-roter" directive in any files yet. Such behavior seems strange for me.
You can only use one routing package in a application. It always conflicts. Try removing Iron Router.
No-no, I haven't any router in the app before.
when meteor starts the next code is executed
meteor://💻app/packages/kadira_flow-router/client/_init.js
// Initialize FlowRouter
Meteor.startup(function () {
if(!FlowRouter._askedToWait) {
FlowRouter.initialize();
}
});
Can you show me installed packages list.
Steps for reproducing
meteor create flow-router-issue
cd flow-router-issue
meteor add kadira:flow-router
meteor run
open a brower on http://localhost:3000 and you will get the next exception in console
router.js:347 There is no route for the path: /
Router._notfoundRoute @ router.js:347
(anonymous function) @ router.js:535
(anonymous function) @ index.js:474
nextEnter @ index.js:306
page.dispatch @ index.js:312
page.replace @ index.js:275
self._page.(anonymous function) @ router.js:382
page.start @ index.js:168
page @ index.js:102
Router.initialize @ router.js:391
(anonymous function) @ _init.js:9
maybeReady @ startup_client.js:26
loadingCompleted @ startup_client.js:38
Debug information
meteor --version Meteor 1.3.2.4
meteor list
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 ecmascript 0.4.3 Compiler plugin that supports ES2015+ in all .js files es5-shim 4.5.10 Shims and polyfills to improve ECMAScript 5 support 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: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 reactive-var 1.0.9 Reactive 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. tracker 1.0.13 Dependency tracker to allow reactive callbacks
I can confirm this... I 've spent the whole day trying to find out what is going on... In addition, if I move my routes.js to /lib, then I face problems when importing html templates which now have to be imported in routes.js as meteor cannot see them anymore in /imports/ui
I can confirm this... I 've spent the whole day trying to find out what is going on... In addition, if I move my routes.js to /lib, then I face problems when importing html templates which now have to be imported in routes.js as meteor cannot see them anymore in /imports/ui
Had exactly the same issues. Only way I could solve it was going to a full meteor modules application structure per the meteor guide: http://guide.meteor.com/structure.html
Seems like overkill for the small demo app I was putting together to demonstrate a different problem but at least it works now.
After lot of testing it seems that either Meteor 1.3 or the FlowRouter is extremely sensitive to errors that did not use to break apps. Most probably the former as now the order of imports is important. For example, I am using the Buttons plugin of DataTables. It could not find some default settings before the actual plugin was loaded next. I had to prefix with 00-
to force loading order in /client/compatibility
, then the error went away and the application starts...
Does anyone found a solution for this problem?
+1
Do I really have to refactor my entire application to fix this?
++ same is this problem solved?
Same problem here. I am in the middle of moving my entire application to /imports and it started popping up about 80% of the way through. No matter what I do I can't get it to recognize the routes I have defined now.
I think I may have the same issue... still researching... but @vmusulainen your steps for reproducing may not be correct. After completing steps 1-4 you still have not created a router file. If you add a routes.js file in /lib with a path for '/' then you shouldn't see the error...
The above does make me think that the error is caused when FlowRouter cannot find the routes file, which is strange in my case as it exists in the /lib directory too...
hi also having this issue. Any updates on this? Can i force it to load first by changing the file name or something?
I fixed this finally. I removed any wait() and ready() callbacks from FlowRouter and handled any redirects inside my React "Application" component. Once I took that logic out of FlowRouter everything worked great.
I also hit this problem now. I'm using Meteor 1.4 release.
My app was working until I git-cloned flow-router to myproj/packages/ and added it to my project. Suddenly FlowRouter could not find any routes.
It turns out it doesn't matter what router you import, if any type of router is part of your project it gets loaded. So I had to remove the old (kadira:flow-router) and then the cloned one worked without the invisible conflict.
For anyone still experiencing this issue, you can try what Nexus7 suggested above, move myroutes.js to /lib but you don't have to move all your components. You can keep your components in /imports/client. I just tried it. Just wrap your import { foo } from '/imports/client/...
stuff with if (Meteor.isClient) {
and your set trigger stuff etc etc.
@Nexus7 - can you post a forked meteor-todos with your change? I'm not following your fix 100%. Thx!
We are facing the same error. Anyone who has solved this issue?
Hello I figured 2 bugs on my side that lead to this error message:
i found a timing issue with FlowRouter and AccountsTemplates, and waiting the FlowRouter.
i found this code in useraccounts_flow-routing:
// Initialization
if (FlowRouter && FlowRouter.initialize) {
// In order for ensureSignIn triggers to work,
// AccountsTemplates must be initialized before FlowRouter
// (this is now true since useraccounts:core is being executed first...)
var oldInitialize = FlowRouter.initialize;
FlowRouter.initialize = function() {
AccountsTemplates._init();
oldInitialize.apply(this, arguments);
};
}
that indicated to me there may be a race condition. whenever i had the failed route, i saw that AccountsTemplates was not yet initialized, so i changed my flow router wait code to include its initialize, and it seems to be working for me (this is at the top of my lib/routes.js):
if (Meteor.isClient) {
FlowRouter.wait();
Tracker.autorun(function() {
if (Roles.subscription.ready() && AccountsTemplates._initialized && !FlowRouter._initialized) {
FlowRouter.initialize()
}
});
}
... i put in this wait originally so i could easily check user roles (a la AccountsTemplates.ensureSignedIn) in some of the routes...
per my comment above, it does look to fix 1 race condition. but i was still able to get into a scenario where there's a blank screen. unsure why: both the AT initialize and the FlowRouter initialize are still false, but the autorun seems to have stopped.
if it helps anyone, i believe i've solved my 2nd race condition. it looks like AccountsTemplates._initialized could flip to true, but the autorun() wouldn't run. further, i attached an onStop() listener to the autorun() to demonstrate that it wasn't stopping.
it's a little ugly, but i used a timer to re-evaluate AccountsTemplates._initialized and invalidate the tracker once it goes true. so far, so good on getting rid of all of my blank screens.
if (Meteor.isClient) {
FlowRouter.wait();
var self = this;
self.getATReady = () => AccountsTemplates._initialized;
var timer = Meteor.setInterval(function() {
if (self.getATReady()) {
tracker.invalidate();
clearInterval(timer);
}
}, 500);
var tracker = Tracker.autorun(function() {
if (!FlowRouter._initialized && Roles.subscription.ready() && self.getATReady()) {
clearInterval(timer);
FlowRouter.initialize()
}
});
}
i'm having the exact same issue when i try to deploy. running:
currently testing the bug with
meteor run --production --settings settings-production.json
Try to solve it with; 1) change the routes.js file location to /import/clients/routes.js 2) change between mup/mupx and new mup deployment.. 3) change to flowrouter ServerSideRendering 4) check for any Ready() 5) tried @szimmers code in routing.js before FlowRouter.route()
Maybe changing to react router would do the trick.. but thats quite some migration effort. If anyone found a solution for the "There is no route for the path: /" in production bundling. That would be great.
Any updates?
Yep, same here! 💅
I cant help. I moved the project to react router. Much lager community to solve these issues.
In my case the /import/client/startup/routes.js does not even run before Flowrouter so of course it has no routes.. I too wait for subscriptions from roles. Cloned flow-router in packages as well.
Having issues here as well.
same here. any progress on this issue?
I my case i follow the answer of @szimmers, it's works while we got a official and better solution.
I faced this issue when I tried to use Bootstrap 4 by placing it in a /main/client/lib/bootstrap/ folder (I attempted a million different methods for importing Bootstrap, no matter what I did it always loaded AFTER my custom css file - hence the lib folder). Bootstrap 4 gave an error in the console (described here: https://github.com/twbs/bootstrap/issues/18732) - "Bootstrap tooltips require Tether."
I downgraded Bootstrap to the latest v3 which doesn't require Tether and the Flow Router issue was resolved.
This is congruent with the issue as described by @pmoulos :
After lot of testing it seems that either Meteor 1.3 or the FlowRouter is extremely sensitive to errors that did not use to break apps.
I had the same problem once, what I did is delete all installed packages from package.json (not the ones who came with Meteor itself), then install one by one, first flow-router, then kadira blaze layout and tested with the two of then. Turns out it was a problem in the initialization of the plugin. It's a guess, but I think that I faced the problem because or I did'nt stopped the server before initialize flow router in first time or it was a package helper to flow router that was throwing an error.
So:
PS; sorry for this bad english
A newbie here. Moving my routes.js to /lib worked for me, but you will have to wrap your code with if(Meteor.isClient){} for your imports to work.
Removing meteor
field (and modules) from package.json
solved here.
Removing
meteor
field (and modules) frompackage.json
solved here.
This worked for me - Thanks @joaocarloscabral !
Hi!
I didn't find the solution for this problem by anything here, but after 8 hours of hacking, i solved it.
I removed the following problematic packages: aldeed:autoform gwendall:auth-client-callbacks dsyko-jquery-ui-touch
My tip for anyone who needs to figure out their own way of solving this bug:
"meteor run --production"
Good luck! / Devmattb
I'm getting this problem on Meteor 1.8, in the most basic setup:
meteor create test
.meteor add kadira:flow-router
.FlowRouter.route('/', {
name: 'home',
action(params, queryParams) {
console.log("Looking?");
}
});
I start my app with meteor
and get this when visiting my app:
There is no route for the path: /
I tried placing routes.js in /client and in /imports/startup/client/. Both result in the same error message.
Am I missing something obvious, or is this a meteor bug?
(I'm running other apps at 1.8, using flow-router, that were upgraded from 1.7x, without a problem.)
Edit:
If I put my routes (what was in routes.js) in main.js, flow-router works.
For those fast-forwarding to the end looking for a solution: the solution given by @joaocarloscabral (https://github.com/kadirahq/flow-router/issues/608#issuecomment-422993963) worked like a charm.
As a side note, in my case the issue was happening during development (with
meteor run
).
Took off the meteor
block from package.json
:
{
"name": "app",
"private": true,
"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.4.5",
"meteor-node-stubs": "^0.4.1"
- },
- "meteor": {
- "mainModule": {
- "client": "client/main.js",
- "server": "server/main.js"
- },
- "testModule": "tests/main.js"
}
}
, restarted meteor run
and things look good so far.
Removing
meteor
field (and modules) frompackage.json
solved here.
Can't believe it works lol
I'm getting this problem on Meteor 1.8, in the most basic setup:
- I create a new app with
meteor create test
.- I add flow router
meteor add kadira:flow-router
.- I add a routes.js with the following code:
FlowRouter.route('/', { name: 'home', action(params, queryParams) { console.log("Looking?"); } });
I start my app with
meteor
and get this when visiting my app:There is no route for the path: /
I tried placing routes.js in /client and in /imports/startup/client/. Both result in the same error message.
Am I missing something obvious, or is this a meteor bug?
(I'm running other apps at 1.8, using flow-router, that were upgraded from 1.7x, without a problem.)
Edit:
If I put my routes (what was in routes.js) in main.js, flow-router works.
Try just import your routes file on main/client.js
import ./routes.js
You don't need to remove that:
"meteor": { "mainModule": { "client": "client/main.js", "server": "server/main.js" }, "testModule": "tests/main.js" }
from the package.json
Thanks @rafaeljcadena
I don't have a /main/ folder. Should I create one in the root of my project?
Thanks @rafaeljcadena
I don't have a /main/ folder. Should I create one in the root of my project?
Ops, my mistake. I should say:
Try just import your routes file on client/main.js
Like this:
import React from 'react';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import App from '/imports/ui/App'
import './routes.js'
Meteor.startup(() => {
render(<App />, document.getElementById('react-target'));
});
It's created by default on Meteor(v1.8). I'm using it with integrated with React.
I have updated Meteor to Meteor 1.3.2.4. and facing the issue. Error : There is no route for the path: / 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
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"}); } });