Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React table Gives empty table in build

This is a very strange issue but I was using react-table 7.0.0.rc16 and I recently upgraded to react-table 7.0.1 the problem is my data works in dev mode but as soon I create a react build it wont render anything I would like to know why and I am attaching my package.json for the same. sandbox

Demo

Package.json

{
  "name": "test",
  "homepage": "http://www.test.com",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "@date-io/date-fns": "^1.3.11",
    "@material-ui/core": "^4.4.2",
    "@material-ui/icons": "^4.4.3",
    "@material-ui/lab": "^4.0.0-alpha.39",
    "@material-ui/pickers": "^3.2.6",
    "bootstrap": "^4.4.1",
    "classnames": "^2.2.6",
    "date-fns": "^2.9.0",
    "echarts": "4.2.1",
    "echarts-for-react": "^2.0.15-beta.0",
    "formik": "^1.5.8",
    "formik-material-ui": "^0.0.22",
    "google-map-react": "^1.1.5",
    "i18next": "^17.0.18",
    "i18next-browser-languagedetector": "^4.0.0",
    "i18next-xhr-backend": "^3.2.0",
    "immutable": "^4.0.0-rc.12",
    "node-sass": "^4.12.0",
    "prop-types": "^15.6.1",
    "react": "^16.9.0",
    "react-csv": "^2.0.3",
    "react-custom-scrollbars": "^4.2.1",
    "react-d3-tree": "^1.16.1",
    "react-dom": "^16.9.0",
    "react-google-maps": "^9.4.5",
    "react-i18next": "^10.13.1",
    "react-redux": "^7.1.1",
    "react-router-dom": "^5.1.2",
    "react-scripts": "^2.0.3",
    "react-table": "7.0.1",
    "redux": "^4.0.4",
    "redux-saga": "^1.1.3",
    "yup": "^0.27.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "watch": "react-scripts start --watch",
    "build": "CI=false react-scripts --expose-gc --max-old-space-size=4096 build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  },
  "devDependencies": {
    "eslint-config-prettier": "^6.4.0",
    "eslint-plugin-prettier": "^3.1.1",
    "prettier": "^1.18.2"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

Package-lock.json is also attached as a file

image of table

image of table when doing prod build

I am using node v10.23.1 and npm 6.14.10.

like image 799
vinayak shahdeo Avatar asked Oct 14 '22 22:10

vinayak shahdeo


1 Answers

This is a problem with react-table v7.0.1, upgrading to v7.0.2 fixes the problem.

It's a minification bug. Here is the exact commit that fixed the problem.

From the Changelog :

7.0.2

  • Fixed an issue where the internal flexRenderer would not work correctly in production due to the strangest friggin' minification bug I've ever encountered. 🤷‍♂️
like image 90
Mohamed Ramrami Avatar answered Oct 19 '22 01:10

Mohamed Ramrami