Uncaught TypeError: axios.default.create is not a function
Hi, I've upgraded getstream from [email protected] to [email protected], but now I'm getting all sorts of errors when I try to connect to the client.
Uncaught TypeError: axios.default.create is not a function
at new StreamClient (client.js:220:1)
at connect (connect.js:46:1)
Here's my React app code for setting up the client.
import { StreamClient, connect } from "getstream";
const useCreateFeedClient = () => {
const { STREAM_KEY, STREAM_APP_ID } = useConfig();
const { data: streamToken } = useStreamTokenQuery();
const [feed, setFeed] = useState<StreamClient>(undefined!);
useEffect(() => {
if (!streamToken) return;
setFeed(connect(STREAM_KEY, streamToken.feed, STREAM_APP_ID));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [streamToken]);
return feed;
};
What am I doing wrong here?
I noticed in 7.4.1 axios is 0.22, but on 8.1.5 axios is 1.4. I'm a bit puzzled. Here's my tsconfig.json just in case.
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
},
"include": [
"src",
"src/service-worker.ts"
]
}
I too am having the same errors
@JimmyPettersson85 can someone take a look into this?
I did a yarn list axios to show what is in my project dependency tree when using 8.1.5 vs 7.4.1.
❯ yarn list axios
yarn list v1.22.19
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ [email protected]
├─ [email protected]
│ └─ [email protected]
├─ [email protected]
│ └─ [email protected]
└─ [email protected]
└─ [email protected]
✨ Done in 0.71s.
❯ yarn list axios
yarn list v1.22.19
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ [email protected]
├─ [email protected]
│ └─ [email protected]
└─ [email protected]
└─ [email protected]
✨ Done in 0.68s.
I had to downgrade to make getstream work (clean-slate installation).
Hello. I'm looking into the issue. If you could provide me some more information about how you're using the SDK I would appreciate, react native?