beforeRouteEnter next(vm => ()) callback not firing

next callback in beforeRouteEnter is not firing.

Simple example:

beforeRouteEnter(to, from, next) {
    next(vm => {
        alert('test');
    });
},

Also tried with console.log, changing component data, etc.

1 Like

This should be fixed in Ionic Vue v5.6.15: fix(vue): router guards are now fired correctly when written in a com… · ionic-team/ionic-framework@3c44222 · GitHub

2 Likes

still not working ? I’m using ionic/vue 5.8.0, ionic/vue-router 5.8.0 with vue3

“@ionic/vue”: {

  "version": "5.8.0",

  "resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-5.8.0.tgz",

  "integrity": "sha512-qm8otUbN5Y3Fg+jpbqZk3Jz45InRuRDPA8jNyd8hdZ8CwlBBN5QcORFwwo2Hdby4mOngFzAJm0c37fml7i4w1g==",

  "requires": {

    "@ionic/core": "5.8.0",

    "ionicons": "^5.1.2"

  }

},

"@ionic/vue-router": {

  "version": "5.8.0",

  "resolved": "https://registry.npmjs.org/@ionic/vue-router/-/vue-router-5.8.0.tgz",

  "integrity": "sha512-x6Y1eV9Ph/XzZa0OICxTXtkd13BZHKzaMg3zsE7tpiniFv0jRs7t3t/quQfsMk9IWr0q9LuNaEuzeHU039iT0g=="

},