content icon indicating copy to clipboard operation
content copied to clipboard

useContent not working with ssr: false

Open Gimanh opened this issue 2 years ago • 2 comments

Environment

Operating System: Darwin Node Version: v16.17.1 Nuxt Version: 3.7.3 CLI Version: 3.8.4 Nitro Version: 2.6.3 Package Manager: [email protected] Builder: - User Config: modules, content Runtime Modules: normalizedModule(), @nuxt/[email protected] Build Modules: -

Reproduction

Clone repository https://github.com/Gimanh/nuxt-content-bug

Describe the bug

Add content into [...slug.vue]

<template>
  <main>
    <ContentDoc />
      {{ data.navigation }}
  </main>
</template>

<script setup>
const data = useContent()
console.log( data.navigation );
</script>

You will see navigation data Then Set ssr: false in nuxt.config useContent will return undefined

Additional context

No response

Logs

No response

Gimanh avatar Oct 03 '23 20:10 Gimanh

I have found a solution here: https://github.com/nuxt/content/issues/2356#issuecomment-1740683996

Hope you sorted

wikett avatar Feb 06 '24 09:02 wikett