Back to Nuxt

NUXT_E3001

docs/errors/e3001.md

4.5.2428 B
Original Source

E3001

The URL passed to useFetch() starts with //. A protocol-relative URL like this resolves to an external host, which is almost never intended and is rejected to avoid leaking requests to a different origin.

Resolution

Use an absolute URL with an explicit protocol, or a relative path:

ts
useFetch('/api/data')
useFetch('https://api.example.com/data')

::read-more{to="/docs/api/composables/use-fetch"} ::