Axios
Backend & InfraPromise based HTTP client for the browser and node.js
Release History
v0.30.3Breaking1 fixThis critical security release addresses a high-priority vulnerability related to prototype pollution leading to Denial of Service (DoS) by restricting the merging of the __proto__ key in configuration objects.
v1.13.53 fixes1 featureRelease 1.13.5 addresses a critical Denial of Service vulnerability in mergeConfig and fixes a bug where the status field was missing from AxiosError objects. It also introduces input validation for isAbsoluteURL.
v1.13.43 fixesThis patch release addresses issues found in v1.13.3 and includes substantial refactoring and improvements to the CI/CD infrastructure.
v1.13.39 fixes7 featuresThis release focuses heavily on bug fixes, including improvements to HTTP2 default ports, interceptor error handling, and better Node.js/Bun compatibility via package.json exports. It also introduces several features like enhanced TypeScript support and better error handling in pipeFileToResponse.
v1.13.22 fixesThis release fixes socket hang‑up issues for keep‑alive requests with timeouts, adds default export support for the http2 module, and improves HTTP loop performance.
v1.13.11 fixThis release fixes a regression in the HTTP handling where data streams were interrupted for non-OK responses.
v1.13.02 fixes1 featureThis release adds HTTP/2 support and fixes several bugs including a TypeError in fetch when config.env is undefined.
v0.30.21 fixVersion 0.30.2 backports a security fix for the maxContentLength option.
v1.12.21 fixThis release fixes the fetch handling by using the current global fetch when no env fetch is specified, preserving MSW support.
v1.12.11 fixThis release fixes environment configuration type handling in the types module.
v1.12.08 fixes4 featuresThis release adds low‑level network error details, fetch adapter env config, parse reviver support, and extends AxiosResponse, while fixing several bugs including content‑type handling and URL encoding.
v0.30.11 fixPatch release v0.30.1 updates the form-data dependency to 4.0.4, fixing related issues.
v1.11.03 fixesThis release addresses several bugs, including fixes for the form-data npm package, a RangeError with large Buffers, and TypeScript type discrepancies between ESM and CJS.
v1.10.03 fixes1 featureThis release improves the TypeScript fetchOptions typing, fixes adapter option passing, corrects FormData boolean serialization, and adds a React Native module entry point.
v1.9.07 fixes1 featureThis release adds a new getSetCookie method to AxiosHeaders and includes several bug fixes across core, fetch, headers, http, and type definitions.
v0.30.05 fixesThis release (v0.30.0) primarily contains bug fixes, including handling aborted requests, updating the changelog, fixing the upgrade guide, backporting a vulnerability fix, and adding the allowAbsoluteUrls type.
v1.8.41 fixBug fix released to improve buildFullPath handling of allowAbsoluteUrls set to false when no baseURL is provided.
v1.8.32 fixesThis release fixes a missing type for `allowAbsoluteUrls` and ensures the flag is correctly passed to `buildFullPath` in both xhr and fetch adapters.
v1.8.21 fixThis patch adds support for absolute URLs in the http‑adapter path builder.
v1.8.11 fixThe update relocates `generateString` to platform utils, preventing the crypto module from being bundled in client builds.
v1.8.0Breaking3 fixes1 featureThis release adds a new `allowAbsoluteUrls` config for URL handling, updates utils to use the crypto module, and includes several bug fixes, but introduces breaking changes to how URLs are combined.
Common Errors
AxiosError5 reportsAxiosError often arises from circular references in the data you're sending, particularly when axios tries to serialize it for the request body. To fix this, either remove the circular references before making the axios call, or use a custom transformRequest function that handles circular structures appropriately, such as by stringifying with a library that can handle them or by omitting the problematic properties. Ensure your data structure is serializable to JSON.
TypeError1 reportThe "TypeError" in Axios often arises when `allowAbsoluteUrls: false` is set in the config but a `baseURL` is missing. Since relative URLs are disallowed without a base, Axios cannot resolve the request URL. Either provide a `baseURL` in your Axios configuration to resolve relative paths, or remove the `allowAbsoluteUrls: false` restriction to permit full URLs.
RemoteInvocationException1 reportRemoteInvocationException in axios usually arises from network connectivity problems or CORS restrictions preventing the client from accessing the server. Ensure the target server is reachable, and if it's a cross-origin request, configure the server to include the correct `Access-Control-Allow-Origin` headers in its response. Also verify any proxy settings in your axios configuration or environment variables are correctly set and functioning.
SyntaxError1 reportA SyntaxError in axios often arises when the response body, especially when using `responseType: stream`, contains malformed JSON that cannot be parsed. Ensure the server responds with valid JSON, or if that's not possible, handle the response as plain text/stream and parse it manually, adding a try-catch block to gracefully handle potential parsing errors.
InvalidOperationException1 reportThe "InvalidOperationException" with Axios often arises when attempting to use the `CancelToken` after the request has already completed or been cancelled. To fix this, ensure you create a new `CancelToken` for each request or properly check the `token.reason` before attempting to cancel. Avoid reusing `CancelToken` instances across multiple requests.
RangeError1 reportRangeError in axios, often triggered by `JSON.stringify`, usually arises from circular references or excessively deep objects within the error object being serialized, exceeding the maximum call stack size. To fix this, either remove the circular references or limit the depth of the object being stringified before passing it to axios' error handling. A common approach is to create a simplified, non-circular version of the error object for JSON serialization.
Related Backend & Infra Packages
Production-Grade Container Scheduling and Management
Node.js JavaScript runtime ✨🐢🚀✨
A modern runtime for JavaScript and TypeScript.
Deliver web apps with confidence 🚀
Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
Free and Open Source, Distributed, RESTful Search Engine
Subscribe to Updates
Get notified when new versions are released