Skip to content

chore: replace axios with native fetch in link-checker#8537

Open
pranavosu wants to merge 2 commits intomainfrom
chore/remove-axios-dependency
Open

chore: replace axios with native fetch in link-checker#8537
pranavosu wants to merge 2 commits intomainfrom
chore/remove-axios-dependency

Conversation

@pranavosu
Copy link
Copy Markdown
Contributor

Description of changes:

Replace axios with Node.js native fetch API in tasks/link-checker.js and remove the axios dependency from package.json.

The project requires Node 20+ which has full native fetch and AbortSignal.timeout() support, making axios unnecessary. This reduces the dependency surface area and eliminates exposure to supply chain risks like the recent axios npm compromise (GHSA-fw8c-xr5c-95f9).

Changes:

  • tasks/link-checker.js: Replace axios.get() with native fetch() + AbortSignal.timeout(5000)
  • package.json: Remove axios from devDependencies, remove follow-redirects resolution (transitive dep of axios)

Related GitHub issue #, if available:

N/A

Instructions

Which product(s) are affected by this PR (if applicable)?

  • amplify-cli
  • amplify-ui
  • amplify-studio
  • amplify-hosting
  • amplify-libraries

Which platform(s) are affected by this PR (if applicable)?

  • JS
  • Swift
  • Android
  • Flutter
  • React Native

Checks

  • Does this PR conform to the styleguide?

  • Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.

  • Are any files being deleted with this PR? If so, have the needed redirects been created?

  • Are all links in MDX files using the MDX link syntax rather than HTML link syntax?

When this PR is ready to merge, please check the box below

  • Ready to merge

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Remove axios dependency and use Node.js native fetch API with
AbortSignal.timeout() in the link checker task. The project requires
Node 20+ which has full native fetch support, making axios unnecessary.

This also removes the follow-redirects resolution from package.json
which was only needed as a transitive dependency of axios.
@pranavosu pranavosu requested a review from a team as a code owner March 31, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants