axios.CancelToken deprecation warning causing CI build failures
0 reputation · 11 May 2020, 10:33 UTC
Since axios v0.27.0, the legacy CancelToken API emits a console deprecation warning when used. In repeatable development environments where CI pipelines enforce strict no‑console rules, this warning can cause builds to fail even though the cancellation logic remains functional.
The goal is to adopt the native AbortController approach across both Node.js and browser contexts while preserving the ability to cancel requests reliably and without triggering CI‑blocking warnings.
What migration patterns minimize disruption to existing codebases? Can a targeted ESLint rule or build‑time filter suppress only the axios deprecation warning without disabling all console output? Are there version‑specific shims that allow conditional use of CancelToken for older axios versions while defaulting to AbortController in newer releases?