Route.register() not a function


#1

Hi all,

using node.js and copying the following from the examples returns
“TypeError: route.register is not a function”

Any hints what is missing. Everything else in my application works flawlessly and this is the last bit missing :slight_smile:

import DefineMap from “can-define/map/map”;
import route from “can-route/can-route”;

const AppViewModel = DefineMap.extend( {
page: “string”
} );
const appState = new AppViewModel();
route.data = appState;
route.register( “{page}”, { page: “home” } );
route.start();

Cheers,

Nada


#2

Which version of can-route are you using?


#3

package.json tells me

“_id”: “can-route@3.0.11”,


#4

register is part of 4.0. You need to upgrade that dependency.


#5

Thx, did not think about that possibility