arthurfiorette / axios-cache-interceptor

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!
https://axios-cache-interceptor.js.org
MIT License
703 stars 58 forks source link

Bug: TypeError: 0, _axiosCacheInterceptor.setupCache is not a function (it is undefined) #730

Closed LouisSyfer closed 11 months ago

LouisSyfer commented 1 year ago

What happened?

Good morning,

I use this package in a react native web application managed by Expo and it works normally. But I just installed it in a native application and when the component where I use axios-cache-interceptor is mounted I get the following error: TypeError: 0, _axiosCacheInterceptor.setupCache is not a function (it is undefined) I can't find anything in the docs on this subject, nor on the Internet.

Thank you for your clarifications

React native version: 0.72.6 expo sdk 49

axios-cache-interceptor version

^1

Node / Browser Version

Node v18.16.0

Axios Version

^1

What storage is being used

Memory Storage

Relevant debugging log output

TypeError: 0, _axiosCacheInterceptor.setupCache is not a function (it is undefined)
arthurfiorette commented 1 year ago

I cannot help you without further information or a reproducible example.

LouisSyfer commented 1 year ago

Well, the reproducible demonstration is simply the documentation. I copied and pasted the codes from the documentation:

import Axios from 'axios'; import { setupCache } from 'axios-cache-interceptor';

const axios = setupCache(Axios); my req: const url = fetchApi +api/posts/allposts?limit=${offset} const res = await axios.get(url);

On the web it's working well. But not in my native app...

arthurfiorette commented 11 months ago

Closed until a proper reproduction repository is linked.