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

Document-driven layout makes useRoute().meta.layout inconsistent #2028

Closed
Tahul opened this issue Apr 19, 2023 · 1 comment · Fixed by #2032
Closed

Document-driven layout makes useRoute().meta.layout inconsistent #2028

Tahul opened this issue Apr 19, 2023 · 1 comment · Fixed by #2032

Comments

@Tahul
Copy link
Contributor

Tahul commented Apr 19, 2023

Environment

Nuxi 3.4.1

------------------------------
- Operating System: Linux
- Node Version:     v16.14.2
- Nuxt Version:     3.4.1
- Nitro Version:    2.3.3
- Package Manager:  npm@7.17.0
- Builder:          vite
- User Config:      modules, content
- Runtime Modules:  @nuxt/content@2.5.2
- Build Modules:    -
------------------------------

Reproduction

https://stackblitz.com/edit/github-fhzzwf?file=layouts/custom.vue

  • Open the index page
    • Console is clean; page renders
  • Open /about page using custom.vue layout
    • Console throws hydration error
    • The object printed on page flickers once the page mounts

Describe the bug

When printing useRoute().meta, the layout key seem to be defined on server-side, but becomes undefined once the app appears.

Additional context

No response

Logs

No response

@Tahul
Copy link
Contributor Author

Tahul commented Apr 19, 2023

spotted by @bdrtsky while working on nuxt-themes/docus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant