Single
Single
Explore posts from servers
NNuxt
Created by Single on 1/28/2025 in #❓・help
Download and serve NuxtImg's from /public folder when generating with SSR true
@kapa.ai Well, it does indeed download the image locally when whitelisting the directus url and not using the directus provider for nuxtimg.
19 replies
NNuxt
Created by Single on 1/28/2025 in #❓・help
Download and serve NuxtImg's from /public folder when generating with SSR true
@kapa.ai 3. did the job - does it ALWAYS enforce the download?
19 replies
NNuxt
Created by Single on 1/28/2025 in #❓・help
Download and serve NuxtImg's from /public folder when generating with SSR true
@kapa.ai 1. is actually what i want - does this only work for images being embeded from the public folder? It doesnt seem to work from images being mebded from an external source (directus).
19 replies
NNuxt
Created by Zeeeth on 10/1/2024 in #❓・help
Add data to store on Page Refresh
Apparently, afterRestore has been renamed to afterHydrate in the latest version
8 replies
NNuxt
Created by Zeeeth on 10/1/2024 in #❓・help
Add data to store on Page Refresh
8 replies
NNuxt
Created by Zeeeth on 10/1/2024 in #❓・help
Add data to store on Page Refresh
We solve this by using pinia-plugin-persistedstate. It saves the token to the sessionStoreage / localStorage and loads it for you automatically. It has a callback method you can use to request the user for the token from the backend once the store is loaded:
...},
persist: {
afterRestore: async ctx => {
const u = await loadYourUser(ctx.store.token)
}
}
...},
persist: {
afterRestore: async ctx => {
const u = await loadYourUser(ctx.store.token)
}
}
8 replies
NNuxt
Created by herbst🌵 on 8/21/2024 in #❓・help
Can't get relative paths in `nuxi generate`
It's hard to say without seeing your code. Your reproduction does exactly what it is supposed to do. ./ => /, thats why only . results into relative paths which might work better depending on your provider. I can't tell why this breaks your subpages without seeing the issue.
13 replies
NNuxt
Created by herbst🌵 on 8/21/2024 in #❓・help
Can't get relative paths in `nuxi generate`
It seems to be related to your hosting provider.
13 replies
NNuxt
Created by herbst🌵 on 8/21/2024 in #❓・help
Can't get relative paths in `nuxi generate`
Yeah that doesn't sound to be nuxt related anymore.
13 replies
NNuxt
Created by herbst🌵 on 8/21/2024 in #❓・help
Can't get relative paths in `nuxi generate`
You have to use a dot only (without slashes) as baseUrl.
13 replies
NNuxt
Created by jd on 8/20/2024 in #❓・help
Docker and Nuxt in production
You need to expose something. If you do not want to expose the API directly, you can use nitro (nuxt-server) as a proxy. In this case, "only" the server has to be exposed but not the api directly. Does this make sense? I guess not.
7 replies
NNuxt
Created by Futuro on 8/19/2024 in #❓・help
I lose my query params on page load
This can happen if you use a reverse-proxy like Cloudflare with a page-redirect-rule that does drop query strings. Is this happening locally too?
4 replies
NNuxt
Created by jd on 8/20/2024 in #❓・help
Docker and Nuxt in production
What we do is, we use a reverse-proxy like https://traefik.io/traefik/ to give managed access to the API and thus expose it to the public.
7 replies
NNuxt
Created by jd on 8/20/2024 in #❓・help
Docker and Nuxt in production
You simply can't. The API call is not being made by the Webserver that is hosting the SSG/Frontend, but the Client (Browser) that visits the site. If this client has no access to the (exposed) API, you can't not do requests against it.
7 replies
NNuxt
Created by Maciej on 8/20/2024 in #❓・help
<NuxtPage> events?
It feels indeed weird to do that. It might not show errors as the recipient does care if the component ever emits an event called some-event but you will have a very hard time to debug this in the future. I'd say for a quick'n dirty page, okay. In general i would not do that.
4 replies