You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using setLocale() to change locale, it causes all of the components to be left in an Unmounted state.
Please see the reproduction. When you click the Change Locale button, which uses setLocale to change the locale, we see this output in console:
onMounted
onMounted
onUnmounted
onUnmounted
The last lifecycle hook that triggered was the onUnmounted hook. Now all components think that they are unmounted when actually they are not unmounted.
This causes all kinds of issues because usually in onUnmounted hook we perform cleanup, remove event listeners etc. and it causes the app to break.
Screenshot:
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Reproduction
https://stackblitz.com/github/martinszeltins/nuxt-i18n-unmounted
Describe the bug
When using
setLocale()
to change locale, it causes all of the components to be left in anUnmounted
state.Please see the reproduction. When you click the
Change Locale
button, which usessetLocale
to change the locale, we see this output in console:The last lifecycle hook that triggered was the
onUnmounted
hook. Now all components think that they are unmounted when actually they are not unmounted.This causes all kinds of issues because usually in
onUnmounted
hook we perform cleanup, remove event listeners etc. and it causes the app to break.Screenshot:
![image](https://private-user-images.githubusercontent.com/34019878/332799100-982a38cc-c50c-48e4-8400-e7e8739184b0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5MzY3MDEsIm5iZiI6MTcxODkzNjQwMSwicGF0aCI6Ii8zNDAxOTg3OC8zMzI3OTkxMDAtOTgyYTM4Y2MtYzUwYy00OGU0LTg0MDAtZTdlODczOTE4NGIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIxVDAyMjAwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2ZTAyNmIxYTc3Mjk3MGZlMTExMDM2MGVmM2Y1NjI1MDU2OGVhNWRmY2UyYjU0OTA3YjkyN2I4YWUyOGM5YzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.H83tNfpn_PwLteKwNQnJKVZMZ6aiZXJHeR-Y_gY2tKA)
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: