kb
Explore posts from serversuseAsyncData/useFetch > Function > Pinia Action - Best practices?
Hey folks, looking for some advice. I currently have something like this
so I already think im using it weird, but then that
fetchDetails
is in the component, and it has some logic on building a payload, which ultimately then fires off a pinia action, and then our pinia action, uses useFetchApi
(which is a composable of $fetch) - so were now at like 4 levels of execution lol, it just feels a bit icky.
Im just wondering what the best practices here might be, like the useAsyncData at the top, would that be advised/not advised given the scenario ive explained?7 replies
Nuxt OG Image works locally but not deployed
Hey, I can see my og image locally in the dev tools, but it is not doing it when deploying.
Is it because it doesnt put the image in
public
folder but instead https://x.vercel.app/__og-image__/image/stores/x-test-store-3733/og.png
I am currently trying a local build & serve10 replies
NuxtImg + Vercel
Im using NuxtImg on Vercel, but I cannot figure out what I need to put in the
nuxt.config.js
because the docs say im supposed to supply every custom width? (https://image.nuxt.com/providers/vercel)
I am running vuetify, and tailwind, if this helps. But as far as sizes, in the given component, im rendering out a few images, with unique sizes per, where im passing this; into my NuxtImg, sizes (in a loop)
So what exactly does my nuxt config want me to put, for it to work on vercel? thx!!11 replies
N2 > 3 server middleware issue
Hey, Im trying to transplant some functionality from a nuxt2 project, where we had
~/server_middleware/authauth.js
which has some imports in like so now in nuxt3, I have made ~\server\api\authauth.post.js
which i think is right? and those same imports with updated pathing like import { getStrategyCredentials, getStrategyEndpoint } from '../../utils/authCredentials'
but I get [15:14:52] ERROR [worker reload] [worker init] Cannot find module 'C:\Users\constants\auth' imported from C:\Users\myuser\Repos\myrepo\.nuxt\dev\index.mjs
any ideas?3 replies
Make Nuxt Icon <Icon> a global component?
Hi, we are using nuxt 3, and im using the NuxtIcon module https://nuxt.com/modules/icon - but right now we dont have our components auto importing, so i wondered how can I make it so I dont need to do
import { Icon } from '#components'
in every component?4 replies
failed to resolve component
have just followed this pretty much verbatim: https://levelup.gitconnected.com/using-fontawesome-icons-with-nuxt-3-e390bd15c0fb
but im getting im using nuxt 3 and haven't imported this component explicitly
4 replies