Single
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:
8 replies
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
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
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
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
<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
api 404
As Alex said, if you
generate
your page. No server is being generated. It is creating a Single Page Application - no backend = no server thus the 404's.
You started the server 'manually' on your local machine thus the API was available, this doesn't count for production. You must use npm run build
instead of generate
and deploy the server (somewhere).44 replies
ogImage is not visible
You can debug it without a cache in place using: https://www.opengraph.xyz/
5 replies
Auto import util VSCode error
Linked with https://discord.com/channels/473401852243869706/1270369207137079319 and https://discord.com/channels/473401852243869706/1270328509784522753
4 replies