RicharDVD
RicharDVD
NNuxt
Created by RicharDVD on 3/27/2025 in #❓・help
Explicit import from local Layer
Using absolute paths with fileURLToPath seems to work 😃
11 replies
NNuxt
Created by RicharDVD on 3/27/2025 in #❓・help
Explicit import from local Layer
@kapa.ai I looked into Layer Aliases but they seem to be registered only when adding layers to the layers folder of your nuxt application. I don't see
#layers
#layers
is registered in the generated tsconfig of the autoatlas layer. I did try to create a custom alias myself, like follows:
export default defineNuxtConfig({
extends: ['../base'],
...
alias: {
'@base': '../../base',
'@base/*': '../../base/*',
},
});
export default defineNuxtConfig({
extends: ['../base'],
...
alias: {
'@base': '../../base',
'@base/*': '../../base/*',
},
});
This seems to resolve correctly inside my editor (so cmd clicking the import works and the red line under the import disappears), but when loading the application I still get the following error message when running the application: Failed to resolve import "@base/app/stores/auth.store" from "app/pages/dashboard/index.vue"
11 replies
NNuxt
Created by RicharDVD on 2/19/2025 in #❓・help
Clear nitro route cache programatically
Odd, I tried this earlier but it didn't work. Maybe I made a typo or something😅
6 replies
NNuxt
Created by psyCOSMO on 1/12/2025 in #❓・help
Nuxt UI late install
Do you have @nuxt/tailwindcss explicitly added in your modules array in the nuxt.config file?
8 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
Thank you for pointing it out. Fixed it😃
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
I did confirm that this was indeed the issue😃 Thank you so much!
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
1 last thing, I have ISR set to 3600 (so 1 hour). Just for my understanding, under what circumstances will the state be leaked since it's hard for me to reproduce?
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
Thank you guys for helping out. I think I will indeed go with this route since it's an easy solution in my case
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
I think you might be right. But let's say I make the navbar client only (which uses some auth logic) it would jump into the page which is not so nice. I think I'd have to just remove the cache rules and see if that works out.
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
I do use isr on some routes
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
That is what makes it so hard
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
The thing is, the same for me😅 It happens only occasionally
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
If you look in their docs, they now say that the npm package is "pinia-plugin-persistedstate". https://prazdevs.github.io/pinia-plugin-persistedstate/frameworks/nuxt.html
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
That is because they moved the module
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
I think that is because you are using an older version of the module. Since 4.0.0 it has updated to piniaPluginPersistedstate (https://github.com/prazdevs/pinia-plugin-persistedstate/releases/tag/v4.0.0)
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
Only thing I could think of was the fact that I access useAuthStore within the onRequest and onResponseError callback. That that might be the reason but not sure
54 replies
NNuxt
Created by RicharDVD on 9/16/2024 in #❓・help
Pinia state leaks across browser sessions
I do indeed use the nuxt module. It is very hard to reproduce since it happens only happens occasionally. For now, I decided to just use a custom composable where the state is stored with
useCookie()
useCookie()
instead of a pinia store. See if we will run into it again. If so, it must be something completely different.
54 replies
NNuxt
Created by Spctr on 10/15/2024 in #❓・help
Frontend middleware auth with backend auth
Happy to help😃
12 replies
NNuxt
Created by Spctr on 10/15/2024 in #❓・help
Frontend middleware auth with backend auth
For the plugin you can just rename the file to [filename].client.ts and for the middleware:
export default defineNuxtRouteMiddleware(() => {
if (import.meta.server) {
return;
}

...
}
export default defineNuxtRouteMiddleware(() => {
if (import.meta.server) {
return;
}

...
}
12 replies
NNuxt
Created by Spctr on 10/15/2024 in #❓・help
Frontend middleware auth with backend auth
I believe your solution would only work client side. I would make the plugin a client only plugin and the route middleware only run on the client (by checking import.meta.server and early returning). See if that helps you any further
12 replies