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:///',
pathRewrite: {'^/product-api': ''}
}
}
Does someone has the same problem, or is there anything wrong in my approach? Thanks!