-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Closed
Description
Describe the bug
When network request failed, axios with fetch adapter should throws AxiosError
(code=ERR_NETWORK, message=Network Error)
but TypeError: Load failed
thrown in Safari.
To Reproduce
Using Safari browser (my user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15
)
and try to fetch where the network request might fail.
you can simply reproduce using esm.sh:
await import('https://esm.sh/axios').then(({ default: axios }) => axios('https://just-fetch-failed', { adapter: 'fetch' }))
Code snippet
import axios from 'axios'
await axios('https://just-fetch-failed', { adapter: 'fetch' })
Expected behavior
Should throws Axios Error: Network Failed
But TypeError: Load failed
thrown.
Axios Version
1.7.9
Adapter Version
fetch adapter
Browser
Safari
Browser Version
18.2(20620.1.16.11.8)
Node.js Version
No response
OS
OSX 15.2
Additional Library Versions
nothing
Additional context/Screenshots
Metadata
Metadata
Assignees
Labels
No labels