bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data

Home Page:http://bvaughn.github.io/react-virtualized/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vite prebuild error

pittleCheung opened this issue · comments

Bug Report

Please include either a failing unit test or a simple repro. You can start by forking this Code Sandbox: https://codesandbox.io/s/03qpzq1p9p?module=%2FExample.js

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React and react-virtualized. Paste the link to your Code Sandbox below:

What is the expected behavior?

Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?

Browser
OS
React
React DOM
react-virtualized

image

this is vite prebuild error

Looks like a duplicate of #1632

I wrote an esbuild plugin to fix this which can also be used for vite: https://npmjs.com/package/esbuild-plugin-react-virtualized

// vite.config.js
import { defineConfig } from 'vite'
import fixReactVirtualized from 'esbuild-plugin-react-virtualized'

export default defineConfig({
  optimizeDeps: {
    esbuildOptions: {
      plugins: [fixReactVirtualized],
    },
  },
})