nuxt / nuxt

The Intuitive Vue Framework.

Home Page:https://nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<script setup> does not run on Pages which where navigated to by <NuxtLink>

FantixX opened this issue · comments

Environment

------------------------------
- Operating System: Windows_NT
- Node Version:     v20.11.1
- Nuxt Version:     3.11.2
- CLI Version:      3.11.1
- Nitro Version:    2.9.6
- Package Manager:  npm@10.2.4
- Builder:          -
- User Config:      devtools, modules, vuefire
- Runtime Modules:  @nuxtjs/tailwindcss@6.12.0, vue3-carousel-nuxt@1.1.1, nuxt-vuefire@1.0.2, @nuxt/image@1.7.0
- Build Modules:    -
------------------------------

Reproduction

https://github.com/FantixX/nuxt-bug-report

Describe the bug

After the dev server is started, the <script setup> of a given page does not seem to run on first navigation to said page when it was navigated to by a <NuxtLink>
It runs as expected when when accessing the page via URL in the browser. It also behaves correctly on each subsequent Navigation via <NuxtLink> after the first one.

Additional context

No response

Logs

No response

@FantixX It's working for sure, but on client side only. SSR or any other rendering mode will only work when navigating via URL

This seems to be working fine in your reproduction:

CleanShot.2024-05-18.at.09.49.38.mp4