I am working on nuxt-edge
+ auth.nuxt
+ vuex
project and in the nuxtServerInit
method of the store I am only logging a message in the console. When the site is reloaded the message gets printed multiple times. This seems to happen only in dev
mode.
Any time an asset is requested from your server that results in an error, Nuxt will render and return an individual error for each file. Error pages are treated like any other page in Nuxt. This means nuxtSeverInit gets called for your initial request and gets called again for each error request on the server.
Check your Network requests to track down each error asset that is requested from your Nuxt server.
Just discovered that with nuxt all internal links should be created with NuxtLink, not href's, I had a menu bar with hrefs and saw api requests where I did not expect them, as I used NuxtServerInit in the store, but some other links did not result in extra api calls, these links were NuxtLink's.
© 2022 - 2024 — McMap. All rights reserved.