Repository navigation
v8.1.1 Optimizer fails with RangeError: WebAssembly.Memory.Grow() on react-icons #23189
Description
Describe the bug
Summary
When using Vite 8.1.1 with react-icons (e.g., react-icons/si, react-icons/fa), the dependency optimizer crashes during the scanning phase with a RangeError: WebAssembly.Memory.grow(): Maximum memory size exceeded. The error originates from the Rolldown‑based optimizer attempting to parse the large barrel exports of react-icons.
Downgrading to Vite 7.2.7 resolves the issue completely, confirming a regression in Vite 8.
Expected Behavior
Vite should successfully pre‑bundle react-icons without crashing, as it does in Vite 7.2.7.
Actual Behavior
The optimizer crashes with a WebAssembly memory error when attempting to parse react-icons barrel files. The error occurs during the prepareRolldownOptimizerRun phase, indicating the new Rolldown‑based optimizer is unable to handle the large number of exports in react-icons.
Additional Context
- The error occurs even with
optimizeDeps.rolldown: false, suggesting the flag is not fully respected or the Rolldown parser is still invoked for certain analysis tasks. - The
react-iconspackage contains large barrel files (e.g.,si/index.mjsexports hundreds of icons), which likely triggers the parser’s memory limit. - The container has 7.6 GiB of RAM available, and Node’s heap limit is 2 GiB, so this is not a system resource issue — it’s a bug in the optimizer’s memory management.
- Workarounds:
- Downgrade to Vite 7.2.7 (stable).
- Use
optimizeDeps.includeto force esbuild pre‑bundling (though this may still fail in some cases).
Reproduction
https://stackblitz.com/edit/vitejs-vite-urontafm?file=src%2FApp.jsx
Steps to reproduce
Steps to Reproduce
-
Create a fresh Vite + React project with Vite 8.1.1:
pnpm create vite my-app --template react-ts cd my-app pnpm add -D vite@8.1.1 -
Install
react-icons:pnpm add react-icons
-
Import any icon set in a component (e.g.,
src/App.tsx):import { SiReact } from 'react-icons/si';
-
Run the dev server:
pnpm dev
-
Observe the crash during dependency scanning:
file:///.../vite/dist/node/chunks/node.js:3517 D > 0 && C.memory.grow(Math.ceil(D / 65536)); ^ RangeError: WebAssembly.Memory.grow(): Maximum memory size exceeded at parse$2 (...) at extractExportsData (...) at async prepareRolldownOptimizerRun (...)
System Info
## Environment
| Component | Version |
|-----------|---------|
| Vite | 8.1.1 |
| `react-icons` | 5.7.0 |
| Node.js | v22.23.2 |
| Package Manager | pnpm 10.34.4 |
| OS | Linux (Docker container, 7.6 GiB available) |
| Plugin | `@vitejs/plugin-react-swc` 4.3.1 |
| `optimizeDeps.rolldown` | `false` (explicitly set, but error still references Rolldown) |
**`vite.config.ts`:**
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
export default defineConfig({
plugins: [react()],
optimizeDeps: {
rolldown: false, // explicitly disabled, but crash still occurs
},
})Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Activity
btea commentedon Aug 6, 2026
Based on the example you provided, vite8.2.0 is installed, and it seems to be working properly.
screen
sapphi-red commentedon Aug 7, 2026
This was fixed in 8.1.2 by #22827