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
I'm using nuxt/http to fetch data from my API using a proxy. This for a replacement of axios due to CORS errors.
Sometimes, not every time, I get this error during fetch ($fetchState.error): "message": "Only absolute URLs are supported", "statusCode": 500
This in dev and in build.
Hi,
I'm using nuxt/http to fetch data from my API using a proxy. This for a replacement of axios due to CORS errors.
Sometimes, not every time, I get this error during fetch ($fetchState.error): "message": "Only absolute URLs are supported", "statusCode": 500
This in dev and in build.
Fetch request
async fetch() {
const res = await fetch(
'/product-api/products?id=XX&category=XX
}
this.product = await res.json()
}
nuxt.config.js
http: {
retry: 1,
proxy: true,
prefix: "/product-api",
},
proxy: {
'/product-api': {
target: 'https://<api_url>/',
pathRewrite: {'^/product-api': ''}
}
}
Does someone has the same problem, or is there anything wrong in my approach?
Thanks!
The text was updated successfully, but these errors were encountered: