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

Unable to translate route of custom pages when those pages are not in the Nuxt pages folder #2873

Open
benjamindedonder opened this issue Mar 22, 2024 · 1 comment

Comments

@benjamindedonder
Copy link

Environment

Local environment:

  • Operating System: Linux
  • Node Version: v20.11.1
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.4
  • Package Manager: [email protected]

StackBlitz reproduction environment:

  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.4
  • Package Manager: [email protected]

Reproduction

https://stackblitz.com/edit/github-8ok7gy

Describe the bug

I am adding new pages from my own module as documented here.
I am configuring route translations as documented here.

And I get a warning: Couldn't find AnalyzedNuxtPageMeta by NuxtPage (...), so no custom route for it.

Additional context

Use case: I want to add and configure new pages in a headless CMS.

I debugged the issue to the getRouteOptionsFromPages function and it seems that the problem is that these pages I added and wish to translate the route of are not present in the Nuxt pages folder.

Logs

No response

@benjamindedonder
Copy link
Author

Update: I was able to resolve this issue by moving my module into it's own Nuxt Layer and making the module create and delete the page components itself inside the Nuxt pages folder of that layer.

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

No branches or pull requests

2 participants