dataProvider is not sending any request after adding axios instance
I have configured an axios instance to handle auth in headers, when I pass it to the dataProvider in the Refine component, no request is sent when entering any view. What am I doing wrong?
4 Replies
Hi @jaoc1811. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Sorry @jaoc1811, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
continuing-cyanOP•2y ago
ok!
after trying some things, I have noticed that the requests stop to send when i use
axiosInstance.interceptors.request.use
to configure the headers of the request
I'm doing it as you say in the docs
are you there now?
firm-tan•2y ago
Hey @jaoc1811, have you been able to resolve the issue? I've tried the code snippet you've provided and had no issue about the requests 🤔 Can you check if you return the
request
in every condition? This issue will happen if any of the code paths doesn't return the request
object in the interceptor fncontinuing-cyanOP•2y ago
I will check it!
I found the error, the JSON.parse functions was failing so the request was not returning
Thank you!