redux-axios-middleware icon indicating copy to clipboard operation
redux-axios-middleware copied to clipboard

Cannot read property 'request' of undefined

Open banmarkovic opened this issue 6 years ago • 2 comments

Anyone encountered this problem while trying to connect redux, axios and redux-axios-middleware in ReactNative app? For some reason I keep getting this error, it seems like something is wrong with function loginWebservice(username, password) { return { type: LOGIN, payload: { request: { url: '/auth/login', method: 'POST', data: { 'name': username, 'password': password } } } } }

I configured axios client and I connected it with redux store.

Also error another error I received is undentified is not an object (evaluating 'setupClient.client.request')

banmarkovic avatar Nov 03 '18 23:11 banmarkovic

I had a similar problem in a multi client configuration one day because my import was wrong :

// OK :
import { multiClientMiddleware } from 'redux-axios-middleware'; 

// This won't work because this imports the default module, which behaves slightly differently 
import multiClientMiddleware from 'redux-axios-middleware'; 

colinux avatar Dec 09 '18 17:12 colinux