table icon indicating copy to clipboard operation
table copied to clipboard

Cell does not render content in production builds

Open nikhilem opened this issue 6 years ago • 33 comments

Describe the bug (required)

In react-table v7.0.0, cells of the table are rendered empty only in production builds of the app, but works in the development server

Provide an example via Codesandbox! (required) Example: Virtualized-Rows sandbox works fine when run in development mode. But, when run by building the project(yarn build), the cells are empty.

Steps To Reproduce (required) Steps to reproduce the behavior:

Build the project and the run the built version, the cells of the table are empty

Expected behavior (Recommended) The built version should works exactly as the development version, the cells of the table should be rendered correctly.

Screenshots

When run locally(development version) image

When run after building(production version) image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 80

Smartphone (please complete the following information): N/A

Additional context React Table version: v7.0.0

Works fine on v7.0.0-rc.10

nikhilem avatar Mar 13 '20 05:03 nikhilem

I have similar issues on my development server, except headers aren't rendering as well (see attached screenshot). v7.0.0-rc.10 does not resolve the issue either. Screen Shot 2020-03-13 at 10 42 47 PM

teagueash avatar Mar 14 '20 05:03 teagueash

Hello, I had just the same problem, you need to check your yarn.lock My resolved version was 7.0.0.rc-16 (even if it was not the one i put in my package.json, which i find strange) After i did a "yarn add" to add a new library in my project, the yarn.lock was unexpectedly updated, the resolved package transformed to the latest stable release, 7.0.0 (not very stable tho) I rolled back my yarn.lock to 7.0.0.rc-16, that fixed my issue

tprata avatar Mar 14 '20 09:03 tprata

Im having this exact same issue with v7.0.0. I will roll back and see if I get anywhere with the v7.0.0rc-16

sammdec avatar Mar 17 '20 12:03 sammdec

Same issue with v7.0.0 on MacOS, Chrome. Works fine when I use v7.0.0.rc-16

Toyobaru avatar Mar 17 '20 22:03 Toyobaru

I came across this same bug, downgrading to v7.0.0-rc.16 fixed the issue for me. Using this with gatsby 2.13.25.

jketcham avatar Mar 17 '20 22:03 jketcham

Same issue here with v7.0.0, works fine with v7.0.0-rc.15 Development server is fine. Production build is not rendering any content, not even header.

alexchen8 avatar Mar 23 '20 22:03 alexchen8

Problem: I faced the same issue too in v7.0.0. To give more info on the issue I faced:

  • render method works if the derived value(column[type]) is a primitive
  • render method doesn't work if the derived value(column[type]) is a function

Observation: As per my quick look, there is some problem due to the minification of the code in the production version. Below is the minified code of the flexRenderer method of the actual source code, in the production version, which is potentially causing the problem: image When I keep breakpoint in the above method and execute using F11, the debugger is not going executing line 185 which handles the case when column[type] is a function.

Patch: As a quick solution, I implemented a patch file by extracting the code necessary from the actual source which I have attached below (change the extension to .js before using). render.service.txt

How to use the patch: Use the patchRenderer method exported instead of cell.render or column.render Column render: Before: column.render('Header') Now: patchRenderer('column', tableInstance, column, null, 'Header', null)

Cell render: Before: cell.render('Cell') Now: patchRenderer('cell', tableInstance, column, {row, cell}, 'Cell', null)

Hope this helps :)

suriyaprashath avatar Mar 24 '20 04:03 suriyaprashath

Thanks @suriyaprashath - Though it looks like its not supporting the filter render. I can report downgrading to v7.0.0.0-rc.16 worked for me. Using react v16.9, styled-components v4.2.0, webpack v4.20.2

alocke12992 avatar Mar 24 '20 07:03 alocke12992

Hi @alocke12992, looks great. Until this is fixed if someone needs to use the latest version along with cell and column render, kindly use the patch in the above comment.

suriyaprashath avatar Mar 24 '20 12:03 suriyaprashath

This bug is VERY VERY strange. Still working on this, but rest assured, the tiny little insect causing this will be hunted and killed as soon as humanly possible.

tannerlinsley avatar Apr 01 '20 22:04 tannerlinsley

I still don't know why this was happening, but I managed to fix it by simply pre-inlining the function that terser was inlining in the end. 🤷‍♂

tannerlinsley avatar Apr 01 '20 22:04 tannerlinsley

Released to 7.0.2

tannerlinsley avatar Apr 01 '20 22:04 tannerlinsley

Thanks @tannerlinsley

nikhilem avatar Apr 02 '20 05:04 nikhilem

I'm seeing this happen on release 7.2.0, but only with the Headers. Downgrading to 7.0.2 resolved it.

brandonparis avatar Jun 19 '20 19:06 brandonparis

@tannerlinsley I am also still seeing this issue with 7.2.1

RileyMShea avatar Jun 26 '20 18:06 RileyMShea

@tannerlinsley Very strange, am still experiencing this with 7.3.0 but only with Netlify/Vercel builds.

kyiii avatar Jul 29 '20 05:07 kyiii

I am also still seeing this issue with 7.5.0

thiagozf avatar Aug 17 '20 14:08 thiagozf

I am also still seeing this issue with 7.5.0

Same here, also experiencing this. This is kind of a big deal I think this should get reopened.

stefanmaretic avatar Aug 21 '20 08:08 stefanmaretic

Still seeing this issue with 7.5.1 in my developer server.

AxelLR992 avatar Sep 29 '20 16:09 AxelLR992

Also seeing this with 7.5.1

pmilla1606 avatar Oct 03 '20 17:10 pmilla1606