question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cell does not render content in production builds

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:33

github_iconTop GitHub Comments

6reactions
tannerlinsleycommented, Apr 1, 2020

Released to 7.0.2

4reactions
suriyaprashathcommented, Mar 24, 2020

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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cell does not render content in production builds #1992 - GitHub
Development server is fine. Production build is not rendering any content, not even header.
Read more >
React route component not rendering in production build
In above code, Body component is rendered in development mode. But when I run the same code in production build body component is...
Read more >
React Data Grid: Cell Rendering - AG Grid
The cell renderer for a column is set via colDef.cellRenderer and can be any of the following types: undefined : Grid renders the...
Read more >
Frequently Asked Questions - Material UI - MUI
[v4] Why aren't my components rendering correctly in production builds? The #1 reason this happens is likely due to class name conflicts once...
Read more >
HTML table basics - Learn web development | MDN
We've talked table theory enough, so, let's dive into a practical example and build up a simple table. ... As you will see,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found