adazzle / react-data-grid

Feature-rich and customizable data grid React component
https://adazzle.github.io/react-data-grid/
Other
6.98k stars 2.18k forks source link

react-data-grid-addons breaks minification in production build #1478

Closed carbonrobot closed 5 years ago

carbonrobot commented 5 years ago

Which version of React JS are you using?

✅ Officially supported ✅

⚠️ Not officially supported, expect warnings ⚠️

☣️ Not officially supported, expect warnings and errors ☣️


Which browser are you using?

✅ Officially supported ✅

⚠️ Not officially supported, but "should work" ⚠️


I'm submitting a ...

👋 Need general support? Not sure about how to use React itself, or how to get started with the Grid? Please do not submit support request here. Instead see

https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md


Issue Details

The react-data-grid-addons module fails to minify in a production build of create-react-app or plain webpack build.

Error in browser console:

react-data-grid-addons.js:2182 Uncaught TypeError: Super expression must either be null or a function, not undefined
    at react-data-grid-addons.js:2182

Steps to reproduce:

$ create-react-app gridtest
$ cd gridtest
$ npm install react-data-grid react-data-grid-addons immutable
$ npm start
import React, { Component } from 'react';
import ReactDataGrid from 'react-data-grid';
import { Toolbar } from 'react-data-grid-addons';

const columns = [{ key: 'id', name: 'ID' }, { key: 'title', name: 'Title' }, { key: 'count', name: 'Count' }];
const rows = [{ id: 0, title: 'row1', count: 20 }, { id: 1, title: 'row1', count: 40 }, { id: 2, title: 'row1', count: 60 }];

class App extends Component {
  render() {
    return (
      <div className="App">
        <ReactDataGrid columns={columns} rowGetter={i => rows[i]} rowsCount={3} minHeight={150} toolbar={Toolbar} />
      </div>
    );
  }
}
export default App;
$ npm run build
$ npm install -g serve
$ serve -s build
slonix commented 5 years ago

I have the same problem as @carbonrobot in my production app. The sample above also breaks. The app works in development but breaks on production build. I am using react@16.8.4.

parthiv1993 commented 5 years ago

I am also facing the same error.

Hewlbern commented 4 years ago

Same issue