Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hook onMounted has been called when app unmount #11037

Open
kkagura opened this issue May 29, 2024 · 1 comment · May be fixed by #11059
Open

hook onMounted has been called when app unmount #11037

kkagura opened this issue May 29, 2024 · 1 comment · May be fixed by #11059
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: suspense

Comments

@kkagura
Copy link

kkagura commented May 29, 2024

Vue version

3.4.21

Link to minimal reproduction

https://github.com/kkagura/test-unmount

Steps to reproduce

  1. open /page1 and click the button to go to /page2
  2. click button to unmount app

What is expected?

hook onMounted in Page2.vue should not be called when app unmount

What is actually happening?

hook onMounted has been called when app unmount

System Info

System:
    OS: macOS 12.2.1
    CPU: (8) arm64 Apple M1
    Memory: 73.73 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
    pnpm: 7.11.0 - ~/.nvm/versions/node/v16.17.0/bin/pnpm
  Browsers:
    Chrome: 125.0.6422.78
    Safari: 15.3
  npmPackages:
    vue: ^3.4.21 => 3.4.27

Any additional comments?

No response

@yangliguo7
Copy link

https://github.com/kkagura/test-unmount/blob/7d8e091fc7215bdd020dbd1df1197f88a8630aa3/src/views/Page2.vue#L8-L10

use mode out-in will trigger mount effect when use unmount. the mount effect will be added to effetc quene

https://github.com/vuejs/core/blob/main/packages/runtime-core/src/components/Suspense.ts#L544-L554

maybe this is indeed a bug .

@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. and removed scope: transition scope: keep-alive labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: suspense
Projects
None yet
4 participants