Module not found: Error: Can't resolve 'url' in '/path/to/node_modules/axios/lib/adapters'
To Reproduce
Run npm i axios
in your terminal, and npm start
, and then in your App.js:
import axios from "axios"
Expected behavior
App running normally
Environment
Axios Version [0.27.0]
Adapter [e.g. XHR/HTTP]
Browser [Chrome]
Browser Version [100.0.4896.127]
Node.js Version [16.13.1]
OS: [macOS 12.3.1]
Additional Library Versions [React 18.0.0]
Additional context/Screenshots
Browser [Chrome] Version 100.0.4896.127
S.O = Windows 10
Additional Library Versions [Vue 3.2.33]
P.D: url = requiere('url') << this import (module) only works in NODE, or am I wrong?
axios/lib/adapters/xhr.js
Line 10
cdd7add
Jiaocz, mustavikhan05, razr130, muammarFaiz, Lucas-jimenez-dev, carlosyahircc, and hahoang1903 reacted with thumbs up emoji
Jiaocz, mustavikhan05, and muammarFaiz reacted with hooray emoji
All reactions
React Native ERROR [Error: undefined Unable to resolve module url from /node_modules/axios/lib/adapters/xhr.js
I'm getting the same. Rolling back to 0.26.0 resolved it for the time being.