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.

ContentDoc with path does not find content

See original GitHub issue

Environment

Nuxt CLI v3.0.0-rc.3-27550969.a4a3cff 12:03:02 RootDir: /sandbox 12:03:05 Nuxt project info: 12:03:05


  • Operating System: Linux
  • Node Version: v14.18.1
  • Nuxt Version: 3.0.0-rc.3-27550969.a4a3cff
  • Package Manager: yarn@1.22.17
  • Builder: vite
  • User Config: modules
  • Runtime Modules: @nuxt/content@2.0.0, @nuxt/ui@0.1.1-27555426.2ead323
  • Build Modules: -

Reproduction

https://codesandbox.io/s/nuxt3-contentv2-blog-demo-zokde1

Describe the bug

I want to use ContentDoc to query blog posts under content/blog by specifying path="/blog" in ContentDoc component.

If I enter <BASE_URL>/blog/my-article I always see the fallback code inside the #not-found slot instead of the index.md located at that path.

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Tahulcommented, May 25, 2022

Hello @Mokkapps 🙂

This PR should resolve the issue: https://github.com/nuxt/content/pull/1143

Thanks for reporting the bug!

0reactions
zdravkovcommented, Nov 6, 2022

The error could also appear if you accidentally place the ‘content’ under another directory 😃 - not the root directory. If you have done it and the fixed it you should clear your cache in order to have it working 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ContentDoc - Nuxt Content
The <ContentDoc> component fetches and renders a single document. An explicit path can be passed to the component with the path prop. If...
Read more >
Rendering contentDoc component properly according to nuxt ...
<ContentDoc path="/blog/my-firs-blog-post/" />. But it doesn't work also... I am wondering what am i doing wrong. I am using Nuxt content ...
Read more >
How to retrieve the file content for a ContentDocument object?
Supposing that you already have the Id of a ContentDocument attached to some record or another, you can get the relevant file content...
Read more >
Document owner is not able to see its owned file when ...
Document owner is not able to see its owned file when OwnerId is changed in a single Apex transaction where the ContentDocument is...
Read more >
Power your blog with Nuxt Content
You can view the full code with styles here You can see that we're no longer using the <ContentDoc /> component to render...
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