NuxtN
Nuxt13mo ago
3 replies
Yuri

The plugin is executed twice

Hello.

I have the plugin (
01.init.ts
), which generates (or refreshes) a token. But it is executed twice: on the server and on the client. But I need the plugin start only once. If it was executed on the server, it should not be executed on the client.

But also I use SPA of this project for mobile app (Capacitor) and I can't to rename plugin to
01.init.server.ts
because in this case the plugin have to start on the client.

What are the appropriate options to solve my problem?
Was this page helpful?