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
Conflicting payloads for dynamic Index Routes #1151
Comments
Another problem in doing this is that the payload does not persist. So if you pass a payload to |
Hi @alidcastano
Can you create a reproduction for the payload approach with different routes @alidcastano ? |
Yeah, I've been using the payload to pass the content's data to pages for the static server build, since requesting the data from Here's are two examples: https://github.com/nuxt-community/nuxtent/tree/master/examples/payload-example
Then click on a link and refresh the page. The navigation links disappear.
You'll see that for index routes it doesn't even generate since there are conflicts with the template / payload of the parent index route and that of its nested children, which seem to be all treated as top level dynamic routes. I understand that it was mainly used for making API calls, but then what would you suggest to use for this scenario? The goal is to incorporate Nuxtent as much into Nuxt as possible, so instead of creating my own route components, I'm just trying to pass the data to them on the static server build so that Nuxt can do the rest. |
Also, |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'd like to pass a payload to non-dynamic routes, so that they can have access to all the data passed to dynamics. For example, it'd be useful for abstracting away content navigation, as you can pass the main root, all it's content's permalinks and titles as a payload.
However, trying to do this with the index route causes problems.
This directory setup doesn't work:
While this setup works:
The problem is that with the index routes, when you generate them, the routes are not prefixed by their base path.
Approach A:
Approach B:
While approach A generates the index routes with their intended permalink path, the payload of the base non-dynamic index root conflicts, as they are all treated as top level dynamic routes.
Approach B does not conflict, but you have to access the route at
index/dynamicPath
, which defeats the purpose.It'd be extremely useful to pass payloads to non-dynamic routes. For this to work with index routes, however, the
index
prefix needs to be treated differently.The text was updated successfully, but these errors were encountered: