Skip to content

Selective ERROR [nuxt] [request error] [unhandled] [500] Invalid query error. #3088

Closed
@danielju91

Description

@danielju91

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 remove the highlighted line, the query succeeds again, regardless of method used to load the pages)
Image

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions