You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our project we are using a custom fetch instance as described in the nuxt docu: https://nuxt.com/docs/guide/recipes/custom-usefetch
We provide the custom fetch instance as $fetchApi to the nuxt context. In particular we are setting the baseUrl on the fetch instance as well as headers.
It now looks like this setup is working for SSR, but for client side rendering the custom fetch instance seems to be ignored as the baseUrl is not respected.
Looking at the implementation of createOpenFetch (
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
In our project we are using a custom fetch instance as described in the nuxt docu: https://nuxt.com/docs/guide/recipes/custom-usefetch
We provide the custom fetch instance as $fetchApi to the nuxt context. In particular we are setting the baseUrl on the fetch instance as well as headers.
Following the custom client configuration as explained here: https://nuxt-open-fetch.vercel.app/advanced/custom-client I now wanted to provide that custom fetch instance to nuxt-open-fetch like:
It now looks like this setup is working for SSR, but for client side rendering the custom fetch instance seems to be ignored as the baseUrl is not respected.
Looking at the implementation of createOpenFetch (
nuxt-open-fetch/src/runtime/fetch.ts
Line 55 in 44ed19c
Is the approach presented above wrong? Is there a different way to incorporate the custom fetch instance on the client side?
Beta Was this translation helpful? Give feedback.
All reactions