A Taro-compatible re-packaging of axios that resolves the browser field issue in Taro's bundler. Current stable version is 1.1.1. It uses Taro's native request adapter instead of XMLHttpRequest, making it work across WeChat Mini Program, Alipay, H5, and other Taro-supported platforms. Ships TypeScript definitions. For Taro 3 use v1.x; for Taro 1/2 use v0.7.0. Differentiator: no browser polyfill needed, supports multipart uploads with custom FileData/PostData classes.
npm install taro-axiosNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import axios from taro-axios and make a GET request in a Taro app.
If using Taro 1/2, install taro-axios@0.7.0
Use import { axios } from 'taro-axios' instead of import axios from 'taro-axios' when using TypeScript.Use new PostData({ field: new FileData(filePath) }) to construct the request body.Run 'npm install taro-axios' (for Taro 3) or 'npm install taro-axios@0.7.0' (for Taro 1/2).
Use 'import { axios } from 'taro-axios'' instead of 'import axios from 'taro-axios''.Upgrade to >=0.7.0 or use 'import { axios } from 'taro-axios''.