DAQEM
DAQEM
NNuxt
Created by DAQEM on 4/22/2024 in #❓・help
SSR issue
When I use npm run dev the script is run on the server side. But when I use it in docker (production), the script is run on the client side. How to do I make them both run on the server side only?
<template>
<div class="relative z-0">
<Header :user="user" />
<div class="px-4 min-h-[50vh]">
<slot />
</div>
<Footer />
</div>
</template>

<script lang="ts" setup>
import Footer from "../components/Footer.vue";

const auth = await getAuth();
const user = auth.value?.user ?? null;
</script>

<style></style>
<template>
<div class="relative z-0">
<Header :user="user" />
<div class="px-4 min-h-[50vh]">
<slot />
</div>
<Footer />
</div>
</template>

<script lang="ts" setup>
import Footer from "../components/Footer.vue";

const auth = await getAuth();
const user = auth.value?.user ?? null;
</script>

<style></style>
9 replies