mui-datatables: setTableProps ignored in prod

When enabling dense table in my local with setTableProps as per example all works as expected. However when released the styles are ignored. The only difference seems to be when I have the env as production (although when in watch mode and production it works) bundling with parcel js.

Anyone else seen this?

Here you can see it working as expected: https://codesandbox.io/s/happy-bhaskara-ft2vo

And here is a a small repo to show it working on yarn start but fails on yarn build then yarn serve https://github.com/wroughtec/tableDemo

It seems to be an issue with production and parcel as the first version I tried with CRA exactly the same code only difference was the scripts worked.

Tech Version
Material-UI 4.7.0
MUI-datatables 2.13.0
React 16.12.0

About this issue

Most upvoted comments

I’m having the same issue with a datatable that has setTableProps: () => ({ size: "small" }):

Here’s the same table with two different build options:

Step 1: rm -rf node_modules ; npm ci ; rm -rf .cache ; parcel build grafik

Step 2: rm -rf .cache ; parcel watch grafik

Hey @wroughtec, not sure offhand what the issue might be, but I can offer this bit of advice for debugging, which has definitely bitten me before. When using semver to manage your packages, it’s possible that you have different versions of dependencies running in production vs local. I would check your production dependency versions against your local versions and see if that’s the case. Any upgrade on any dependency might have broken something. If I’m on a project where I need to be extra cautious about this happening, I will stop using semver in my package files, and make sure to use only exact versions.