Server side pages without server directory for api calls
Can we use pinia store methods server side
5 Replies
Yes
How
I am getting cannot stringify non POJO
@cuebit
I did use useasyncData to call server methodds (api calls ) on my page
which is not giving me an error but my page source doesn't contain the data
Do you have anything to show to give us indication of what the issue could be? Maybe a minimal repro on https://nuxt.new
From a
.vue
page I use this api from a method in a pinia store and it runs server side:
I'm using unsecureFetch
(based on ofetch
) because $fetch
uses a default Agent that can't be overridden to ignore a certificate. However, this isn't the core issue here but it shows that Pinia methods can run server side. The problem seems to lie in how useAsyncData
is being used. Hope this helps a bit.Thanks for this will try