question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: vue, lifecycle hooks not fired with vue 3.2 setup

See original GitHub issue

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

This code in component is never trigger :

  onIonViewDidEnter(() => {
      console.log('About page did enter');
    });

  onIonViewDidLeave(() => {
    console.log('About page did leave');
  });

  onIonViewWillEnter(() => {
    console.log('About page will enter');
  });

  onIonViewWillLeave(() => {
    console.log('About page will leave');
  });

Expected Behavior

this should be triggered during routing

Steps to Reproduce

you can clone : https://github.com/riderx/ionicv6-beta-vue-vite yarn and yarn dev

Code Reproduction URL

https://github.com/riderx/ionicv6-beta-vue-vite

Ionic Info

Ionic:

Ionic CLI : 6.17.0

Utility:

cordova-res (update available: 0.15.3) : 0.15.2 native-run : 1.4.0

System:

NodeJS : v16.7.0 npm : 7.20.3 OS : macOS Monterey

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
liamdebeasicommented, Nov 23, 2021

Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/24253, and a fix will be available in an upcoming release of Ionic Framework.

Big thanks to @snowwolfjay for creating the fix!

1reaction
snowwolfjaycommented, Nov 14, 2021

any progress? because the router cache, it looks like disaster, because when you just need open one page, it open five visited for you… go(-1)/replace / back not clear the cache.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: vue, lifecycle hooks not fired with vue 3.2 setup · Issue ...
This looks like an incompatibility with the new <script setup> feature in Vue 3.2.
Read more >
A Complete Guide to Vue Lifecycle Hooks - with Vue 3 Updates
The updated lifecycle event is triggered whenever reactive data is modified, triggering a render update. beforeUpdate() and onBeforeUpdate().
Read more >
Composition API: Lifecycle Hooks - Vue.js
This hook can be used to access the DOM state before Vue updates the DOM. It is also safe to modify component state...
Read more >
use onMounted Hook - vue.js - Stack Overflow
I get this errors: [Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs ......
Read more >
Vue 3 Script Setup, The Future Of Vue? Tutorial And Setup
Vue.js has a new Script Setup feature that is changing the way you create Vue apps. Should you use it? In this video...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found