Ion-menu not working after back-button press

I’m New to ionic and try my first project.
When I click on a link and then ion-back-button the ion-menu 's does not work.
When I click on a link again it works.
The BaseLayout.vue file:

<template>
    <ion-page>
    <ion-router-outlet id="main"> </ion-router-outlet>
        <menu-left></menu-left>
        <menu-right></menu-right>
        <ion-header>
            <ion-toolbar>
                <ion-buttons slot="start">
                    <ion-menu-button></ion-menu-button>
                    <ion-back-button color="danger"></ion-back-button>
                </ion-buttons>
                <ion-title>Test title
                   <div class="test1"> <router-link to="/r2/"> TEST 1</router-link></div>
                </ion-title>
                <ion-buttons slot="end">
                    <ion-menu-button></ion-menu-button>
                </ion-buttons>
            </ion-toolbar>
        </ion-header>
        <ion-content>
            <slot />
        </ion-content>
    </ion-page>
</template>

in the router/index.js file

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})
export default router

Did you ever resolve this? I am having the exact same issue.

1 Like

Any Update on this? I am facing the same issue. @shill83 @goser @ Acarvalheiro

I am also facing this problem with the latest version of Ionic, but I believe I found a solution.

In my case, because the side menu is included inside a custom header component, is being recreated in every page, regarding being used or not. When navigating back to the main page, the side menu from the previous page is still the last “side menu declared”, and therefore doesn’t work.

The trick for me was to use *ngIf on the ion-menu tag to only declare the side menu on the main page (dialog=false); this way when I call the secondary page, the side menu is not being redeclared and I when I nav back the last side menu declared is still the one on the main page, so the menu button works again.