NuxtN
Nuxt2y ago
cosbgn

Props based on route generate hydration missmatch

// /pages/tools/[tool_slug].vue
<template>
    <div>
        <tool :config="tools[tool_slug]" />
    </div>
</template>
<script setup>
import tools from '~/assets/templates/en.json'
const route = useRoute()
const { tool_slug } = route.params
if (!tools?.[tool_slug]?.title) {
    throw createError({ statusCode:404, statusMessage:"Tool not found" })
}
</script>


I want to do something like the above. My issue is that I get a missmatch because confi is empty on server and filled in client.

Is there a way to have it filled also on server?
Was this page helpful?