Skip to content

definePageMeta validate not working as expected #31102

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

Open
lulcca opened this issue Feb 24, 2025 · 5 comments
Open

definePageMeta validate not working as expected #31102

lulcca opened this issue Feb 24, 2025 · 5 comments
Labels

Comments

@lulcca
Copy link

lulcca commented Feb 24, 2025

Environment

Nuxt Version: 3.15.4

Reproduction

https://stackblitz.com/edit/github-jeicynwl

Describe the bug

Nuxt documentation says that, when returning false in validate, it will check for other possibilities; but this does not happen, we receive a 404 page not found error.

Image Image Image

Am I doing something wrong?

Copy link

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@Mini-ghost
Copy link
Member

This seems to be related to your file structure. From the Nuxt DevTools, it appears that the corresponding route configuration only matches [slugOne].vue, but not [slugTwo].vue, based on your current file structure.

Image

@lulcca
Copy link
Author

lulcca commented Feb 24, 2025

A and B should match [slugOne].vue, C and D should match [slugTwo].vue

same display if I had a catch-all route

if I make [slugOne].vue optional, i.e [[slugOne]].vue, it starts matching [slugTwo].vue primarily and we get the opposite behavior (C and D become valid routes, A and B throws page not found error).

@huang-julien
Copy link
Member

this seems more like an issue with vue-router to me

@huang-julien
Copy link
Member

This is currently a limitation we have in vue-router but can possibly solved with vuejs/router#2415

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

No branches or pull requests

3 participants