question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Second call `queryContent` in `useAsyncData` never resolve

See original GitHub issue

Environment

  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.8-27687584.51dc736
  • Package Manager: yarn@1.22.10
  • Builder: vite
  • User Config: modules
  • Runtime Modules: @nuxt/content@2.1.0-27687576.9b9b648, @nuxt/ui@0.3.1-27672317.7f8e554
  • Build Modules: -

Reproduction

  1. https://stackblitz.com/edit/github-6ahpka?file=app.vue
  2. https://stackblitz.com/edit/github-6ahpka-h93acz?file=app.vue

Describe the bug

In my example, tags are first quered, then posts by tag name. The second calls queryContent to find posts stuck and never resolves. If you change the order of calls, the posts will be loaded and the tags will “stuck”

Additional context

No response

Logs

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cawa-93commented, Sep 11, 2022

Looks like we can wrap both queries with Promise.all([query1, query2]). With this it worked for me.

It’s will not work if second queri depend first

0reactions
kirtan403commented, Nov 10, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Power your blog with Nuxt Content
In <script> , we're using useAsyncData to fetch the document with queryContent() based on the current path gotten from useRoute() . Within ...
Read more >
Querying - Nuxt Content
The queryContent() function is auto-imported by Nuxt Content to build queries ... Wrap your query in the useAsyncData composable (auto-imported as well).
Read more >
error loading dynamically imported module - You.com | The AI ...
I am using useAsyncData and queryContent to get the content for these pages then ContentRenderer and ContentRendererMarkdown to display them. Describe the bug....
Read more >
content - githubmemory
[Docs] Footer icons are partially broken · How to auto import Components in Source Content folder? · Second call `queryContent` in `useAsyncData` never...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found