Ion menu issue

I have build my Ionic 5 app and have a sidemenu on my home page . When I swipe to open my side menu immediately after the app loaded, the app freezes. Here is the error stack. What is the possible solution for this issue ?

ion-menu_3.entry.js:215 Uncaught (in promise) TypeError: Cannot read property ‘offsetWidth’ of undefined
at Menu.loadAnimation (ion-menu_3.entry.js:215)
at Menu._setOpen (ion-menu_3.entry.js:207)
at Object._setOpen (index-0d58a5bf.js:239)
loadAnimation @ ion-menu_3.entry.js:215
_setOpen @ ion-menu_3.entry.js:207
_setOpen @ index-0d58a5bf.js:239
Promise.then (async)
scheduleMicroTask @ zone-evergreen.js:552
scheduleTask @ zone-evergreen.js:388
scheduleTask @ zone-evergreen.js:210
scheduleMicroTask @ zone-evergreen.js:230
scheduleResolveOrReject @ zone-evergreen.js:847
resolvePromise @ zone-evergreen.js:785
(anonymous) @ zone-evergreen.js:705
Promise.then (async)
(anonymous) @ zone-evergreen.js:1060
ZoneAwarePromise @ zone-evergreen.js:960
Ctor.then @ zone-evergreen.js:1060