Closed
Description
Environment
WSL Ubuntu 24.04
Node version v23.6.1
[email protected]
[email protected]
@nuxt/[email protected]
Version
3.15.4
Reproduction
https://stackblitz.com/edit/github-kvpjf65n?file=app%2Fcomponents%2Fcontent%2Fblog-posts.vue
The routes where the problem component is displayed:
/
/blog
Description
This behavior happens when I am using queryCollection composable to query markdown content list with ordering.
- The component was functioning correctly until I added it to one more .md file, app/content/index.md. Originally I only had it in app/content/blog/index.md
- Upon adding
::blog-posts
to the app/content/index.md file, the component started exhibiting the following behavior:- When I navigate to the pages through
<NuxtLink>
buttons (by clicking My name, Main or Blog in the top bar), , the component works as expected. - However, when I refresh the page while on that route or go directly to that route, the query fails and the terminal prints:
ERROR [nuxt] [request error] [unhandled] [500] Invalid query
- When I remove, the .order('publishedAt', 'DESC') line from the query chain inside
blog-posts.vue
this symptom goes away, the above error no longer occurring upon refreshing or directly visiting the problem routes by typing in the url. The list of posts display as intended as well.
- When I navigate to the pages through
(When I remove the highlighted line, the query succeeds again, regardless of method used to load the pages)
Additional context
No response
Logs
✔ Vite server hmr 20 files in 446.46ms
collectionQuery Promise { <unknown> }
ERROR [nuxt] [request error] [unhandled] [500] Invalid query
undefined
Metadata
Metadata
Assignees
Labels
No labels