I'm migrating a Vue 3 SSR project to Nuxt.
But I'm facing a challenge with the routes.
The project has a single file page working as a "catch-all" but named ScenePage.vue
The app works with routes being declared on the backend, as the same for the content of each page (on the frontend we "just" build components, that when a route is requested we will receive a JSON with the structure of the pages, including the components and the props to populate the components)
The challenge on Nuxt because of the file-based route system is to replicate this correctly.
Already tried a few options, but none of them match the requirements
- using router.options works 50% as it's only executed once, and my app receives more routes after the user logs in
- pages:extend hook on nuxt.config has a similar problem as it also is executed only once
- module + plugin, it doesn't work on SSR, only on the client
- server middleware + plugin + composable, I see the list of routes from the request, also see that it is passed using event.context.routes and then available on nuxtApp.payload.routes, but it appears that the routes aren't registered as I end up on the 404, but from the logs I have added I see after the [Vue Router warn]: No match found for location with path "/"
Any help would be very helpful
Thanks