esbuild-plugin-react-virtualized

raw JSON →
1.0.6 verified Mon Apr 27 auth: no javascript

ESBuild plugin that fixes the 'No matching export' error for react-virtualized by rewriting broken import statements. Version 1.0.6 is the latest stable release, with frequent updates (4 releases in 2024, 2 in 2025-2026). It is a lightweight, zero-config plugin that patches the specific export issue in react-virtualized's WindowScroller module. Unlike manual workarounds (e.g., patching node_modules), this plugin integrates cleanly into ESBuild and Vite esbuild optimization pipelines.

error Error: No matching export in "node_modules/react-virtualized/dist/es/WindowScroller/WindowScroller.js" for import "bpfrpt_proptype_WindowScroller"
cause react-virtualized exports a TypeScript type that is not properly handled by ESBuild during bundling.
fix
Use esbuild-plugin-react-virtualized as shown in the quickstart.
error TypeError: fixReactVirtualized is not a function
cause Incorrect import type (default vs named).
fix
Use default import: import fixReactVirtualized from 'esbuild-plugin-react-virtualized'
error SyntaxError: Unexpected token 'export'
cause Using CommonJS require() on an ESM-only package.
fix
Switch to ESM imports (e.g., use 'import' syntax) or configure your runtime to handle ESM (e.g., with --experimental-vm-modules in Node).
breaking Package is ESM-only; does not provide a CommonJS build. Attempting to require() it will throw an error.
fix Use ESM imports or dynamic import() instead of require(). If using Jest or other CJS environments, ensure you have ESM support (e.g., --experimental-vm-modules).
gotcha The plugin only fixes the specific export error for 'bpfrpt_proptype_WindowScroller' from react-virtualized. Other react-virtualized import issues are not addressed.
fix If you encounter other errors from react-virtualized, consider using a different virtualized library or patching manually.
deprecated react-virtualized is in maintenance mode and not actively developed. Consider migrating to react-window for better performance and smaller bundles.
fix Replace react-virtualized with react-window and use its planned esbuild plugin if needed.
npm install esbuild-plugin-react-virtualized
yarn add esbuild-plugin-react-virtualized
pnpm add esbuild-plugin-react-virtualized

Demonstrates basic usage of the plugin with esbuild build to fix react-virtualized import errors.

import * as esbuild from 'esbuild'
import fixReactVirtualized from 'esbuild-plugin-react-virtualized'

await esbuild.build({
  entryPoints: ['app.js'],
  bundle: true,
  outfile: 'out.js',
  plugins: [fixReactVirtualized],
})