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.

Prerendering fails when we use Nuxt content v2 with Nuxt 3

See original GitHub issue

Environment

Nuxt CLI v3.0.0-rc.4 11:15:44 RootDir: /Users/fayaz/Opensource/logspot 11:15:45 Nuxt project info: 11:15:45


  • Operating System: Darwin
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-rc.4
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: modules, content
  • Runtime Modules: @nuxtjs/tailwindcss@5.1.3, @nuxt/content@2.0.1
  • Build Modules: -

Reproduction

Open this stackblitz link - https://stackblitz.com/edit/nuxt-starter-hgwgav?file=app.vue

  1. Install the dependencies - npm install
  2. Run the dev server - npm run dev - you can see it runs fine
  3. Stop and run npm run generate - You can see the error below
ERROR  'fetchContentNavigation' is not exported by virtual:nuxt:/home/projects/nuxt-starter-hgwgav/.nuxt/imports.mjs, imported by node_modules/@nuxt/content/dist/runtime/components/ContentNavigation.mjs

Describe the bug

I am using the useAsyncData in my setup script to retrieve data from content folder.

<script setup>
const { data: posts } = await useAsyncData('feed', () =>
  queryContent('/').find()
);
</script>

Additional context

Note, this is only happening when we use it with Nuxt content module. I created a different project without nuxt content and npm run generate worked without any issues.

Logs

ERROR  'fetchContentNavigation' is not exported by virtual:nuxt:/home/projects/nuxt-starter-hgwgav/.nuxt/imports.mjs, imported by node_modules/@nuxt/content/dist/runtime/components/ContentNavigation.mjs

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vinayakkulkarnicommented, Jul 24, 2022

Go to: https://vinayakkulkarni.dev

If you go to the blog link & then navigate to main page by clicking on the logo on the top, the main screen/page content isn’t shown 😦

Repo source code: https://github.com/vinayakkulkarni/vinayakkulkarni.dev

Using Nuxt 3 w/ Nuxt content v2 deployed to netlify

1reaction
danielroecommented, Jul 8, 2022

I haven’t looked into this, but it might be fixed by https://github.com/nuxt/framework/pull/5763.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt Server Side Rendering vs Pre-rendering
To build your Nuxt project using Server Side Rendering (SSR) you need to ensure your target is server in your Nuxt config file....
Read more >
Changelog - Nuxt Content
After months of work we are finally officially releasing @nuxt/content v2. This update main objective was to be fully compatible with Nuxt 3....
Read more >
Rendering <NuxtImg> in @nuxt/content (v2) markdown file ...
0-27769790.4b27db3), I am getting this error while running in development ( yarn run dev ): [Vue warn]: Failed to resolve component: NuxtImg If ......
Read more >
Power your blog with Nuxt Content
In this article, we'll look at the Content v2 module, what's new, its use cases and applications, and how we can use it...
Read more >
Create an RSS Feed With Nuxt 3 and Nuxt Content v2
As the next step, we need to add the Nuxt Content v2 module to our application. ... We can do this by using...
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