Skip to content

Jye10032/axios-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Axios fetch adapter destructuring repro (Vite + React)

This repo reproduces a module-load crash in axios 1.13.2 when the fetch adapter destructures utils.global during build/preview.

Requirements

  • Node.js 18+ (or your current project version)

Steps to reproduce

  1. Install dependencies:
npm install
  1. Build and preview:
rm -rf node_modules/.vite dist
npm run build
npm run preview
  1. Open the preview URL and check the browser console.

Expected error

TypeError: Cannot destructure property 'Request' of 'undefined' as it is undefined

Depending on source maps, the stack may point to:

  • fetch.js:15 (source-mapped axios file), or
  • index-*.js (bundled output).

If you want the stack to show fetch.js, enable source maps by adding this to vite.config.js:

build: { sourcemap: true }

Versions

This repo pins the key versions to match the original environment:

  • axios 1.13.2
  • vite 4.4.5
  • @vitejs/plugin-react 4.0.3
  • react 18.2.0 / react-dom 18.2.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors