content
content copied to clipboard
useContent not working with ssr: false
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
I have found a solution here: https://github.com/nuxt/content/issues/2356#issuecomment-1740683996
Hope you sorted