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

Page mounted twice #10873

Open
Kolobok12309 opened this issue Dec 29, 2022 · 1 comment · May be fixed by #10874
Open

Page mounted twice #10873

Kolobok12309 opened this issue Dec 29, 2022 · 1 comment · May be fixed by #10874

Comments

@Kolobok12309
Copy link
Contributor

Versions

  • nuxt: 2.15.8
  • node: v14.19.0

Reproduction

https://codesandbox.io/p/github/Kolobok12309/nuxt-page-layout-mount-twice/draft/stoic-beaver - playground
https://github.com/Kolobok12309/nuxt-page-layout-mount-twice - repo

Steps to reproduce

  1. Config nuxt
// nuxt.config.js
export default {
  features: {
    transitions: false,
  },

  build: {
    splitChunks: {
      layouts: true,
    },
  },
}
  1. Create 2 layouts and 2 pages
  2. Add console.log('mounted', this.$nuxt.layoutName) to mounted hook of each page
  3. Go from one page to another

What is Expected?

// from page-1 to page-2
mounted layout-2
// page-2 to page-1
mounted layout-1

What is actually happening?

// from page-1 to page-2
mounted layout-1
mounted layout-2
// page-2 to page-1
mounted layout-2
mounted layout-1

Additional info

If i set features.transitions: true, all to be fine, but we can't use it(some problems with meta)

@Kolobok12309
Copy link
Contributor Author

Similar issue #5703

Kolobok12309 added a commit to Kolobok12309/nuxt.js that referenced this issue Dec 29, 2022
@Kolobok12309 Kolobok12309 linked a pull request Dec 29, 2022 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants