This repo reproduces a module-load crash in axios 1.13.2 when the fetch adapter
destructures utils.global during build/preview.
- Node.js 18+ (or your current project version)
- Install dependencies:
npm install
- Build and preview:
rm -rf node_modules/.vite dist
npm run build
npm run preview
- Open the preview URL and check the browser console.
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), orindex-*.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 }
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