-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
axios complains about adapter field in config object #79
Comments
My solution was: const httpAdapter = new HttpAdapter({
basePath: '[some url]',
http: (config) => {
// axios will use it's default adapter
config.adapter = null;
return axios(config);
}
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code example on js-data-http guid simply does not work for me:
It throws error:
TypeError: adapter is not a function at dispatchRequest (/Users/ismail.niftaliev/Documents/demo/dummy_server/node_modules/axios/lib/core/dispatchRequest.js:59:10) at <anonymous> at process._tickCallback (internal/process/next_tick.js:189:7) at Function.Module.runMain (module.js:696:11) at startup (bootstrap_node.js:204:16) at bootstrap_node.js:625:3
The problem is in config object which you send to axios
you set
adapter: 'http'
and axios first checks if config has an adapter then uses it if not uses default adapter and then calls it as a function, so while you set a string as a value for adapter it makes axios crazy.
Thanks!
The text was updated successfully, but these errors were encountered: