Steps needed to switch from `kadira:flow-router` to `ostrio:flow-router-extra`

Apologies for my noob question, I don’t have much experience with frontend development.

I currently have both kadira:blaze-layout and ostrio:flow-router-extra installed. It seems that kadira:flow-router is still imported in my frontend code (this is code written from my former frontend dev) whenever I access FlowRouter as in:

import { FlowRouter } from 'meteor/kadira:flow-router';

In order to completely switch to the recommended package from ostrio:flow-router-extra as mentioned in https://guide.meteor.com/routing.html#flow-router (BTW, the section about Using Flow Router seems to be outdated/duplicated as it points to the same meteor add), how I can safely remove those import statements without breaking the app?

Is there a need for the meteor/kadira:flow-router from the kadira:blaze-layout package?

Thanks in advance,

Andreas

@a4xrbj1 I think the API for the ostrio:flow-router-extra is the same as the kadira:flow-router, so you should be able to just swap the import from import { FlowRouter } from 'meteor/kadira:flow-router' to import { FlowRouter } from 'meteor/ostrio:flow-router-extra'.

The kadira:blaze-layout package doesn’t require the kadira:flow-router as a dependency, so you should be able to just remove and change the imports where you use.

Thank you so much, Matheus, that’s very helpful.

I’ve replaced all as you suggested:

I’ve also checked that the package is no longer installed

meteor remove kadira:flow-router
kadira:flow-router is not a direct dependency in this project.

However my app isn’t running properly anymore, the login isn’t working anymore as it is trying to find a route in kadira:flow-router still:

In

Router.prototype._notfoundRoute = function(context) {

I get

console.error("There is no route for the path:", context.path);

I’ve searched for kadira in my source code and then only two references (apart from kadira:blaze-layout) is in the versions file as in kadira:flow-router@2.12.1.

and

Local package version is up-to-date: kadira:flow-router@2.12.1 in meteor.log file.

If I remove that line from versions then it’s being added again:

Changes to your project's package version selections:

kadira:flow-router  added, version 2.12.1

I have no idea what is wrong and what I need to do to fix this

@a4xrbj1 Hmm, I think you have some package that depends on the kadira:flow-router. In this case, you will either need to update this specific package to a version that uses the new flow-router package you want, or fork it on your packages folder and replace the flow-router package yourself.

You can check the dependencies of the packages you use by running meteor list --tree in your project root - with this output you can easily find which package is using the kadira:flow-router.

You are right, Matheus.

useraccounts:flow-routing@1.15.0
├── check@1.3.1 (top level)
├─┬ kadira:flow-router@2.12.1

It’s the useraccounts:flow-routing package that is my problem.

I’m still on Meteor 2.5.8 due to the breaking changes. Well, I guess I need to finally do the required code changes in my frontend app.

I did update to Meteor version 2.9.1 however the useraccounts:flow-routing package wasn’t updated and is still on version 1.15.0 (thus requires kadira:flow-router).

So my app starts but I can’t login as I still get the:

console.error("There is no route for the path:", context.path);

error.

I’ve checked the guide but useraccounts:flow-routing isn’t mentioned anywhere. Is there a new version that is managed by the community instead? This package wasn’t touched for 6 years it says.

Thanks in advance!

Ok, found it out. The solution was to:

meteor add useraccounts:flow-routing-extra

and then

meteor remove useraccounts:flow-routing

I just wish someone would add to the guide that we should use Ostrio’s useraccounts:flow-routing-extra package.

The app starts and I can login now. Only warning I get is this:

FlowRouter.notFound is deprecated, use FlowRouter.route('*', { /*...*/ }) instead!

no idea why.