table icon indicating copy to clipboard operation
table copied to clipboard

Fails after upgrading to v6.9.0 or later

Open norman-gamage opened this issue 7 years ago • 10 comments

Using v6?

Yes

Using v7?

No. However, tried with v7.0.0-alpha.2, and this issue exists.

Describe the bug When updating from v6.8.6 to v6.9.0, pages with react-table fails with following error,

Cell(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

Update (2019 Mar 11): Further investigation suggests that, this error appears if one or more data fields required in react-table column list are missing.

Example, assume a table that renders columns id and line. If the JSON data fed into table has entries where either id or line key-value pairs are missing, entire rendering process fails with above error.

v6.8.6 and prior were able to render empty column/cell fields, if relevant data is unavailable. It seems, this safe guard is unavailable from v6.9.0 onwards.

To Reproduce Steps to reproduce the behavior:

  1. Prepare a working React app with react-table (v6.8.6)
  2. Implement a page with working table
  3. Install newer react-table version, v6.9.0 or higher using npm
  4. Try to access page implemented in step 2
  5. See error, should be as or similar to screenshot below

Expected behavior Should work flawlessly as in react-table v6.8.6.

Codesandbox!

Update (2019 Mar 11): Code sample to re-produce this bug is now available here.

Screenshots image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Google Chrome
  • Version: v72 and above

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

Additional context N.A.

norman-gamage avatar Mar 10 '19 07:03 norman-gamage

Issue description has been updated with additional details and code sandbox

norman-gamage avatar Mar 11 '19 08:03 norman-gamage

Having the same issue after upgrading from 6.8.6 to 6.9.2. Appears in a pretty much stable fashion, when some of the fields submitted to Cell are undefined. Windows 10 / Ubuntu 18, Firefox / Chrome.

sainnr avatar Mar 13 '19 11:03 sainnr

same for me, downgrading from 6.9.2 to 6.8.6 fixed my failing tests

zlorfi avatar Mar 14 '19 08:03 zlorfi

We found that explicitly returning null instead of undefined (what we had been returning previously) fixes this issue for us. undefined should be being treated as null though.

MatthewHerbst avatar Mar 18 '19 19:03 MatthewHerbst

Ran into a similar issue.

To add a bit more context to what I found while debugging, the issue was limited to using a custom Cell renderer. The error occurred when the Cell renderer function returned undefined. Updating the Cell renderer function to return null in such cases fixed the issue for me.

davegw avatar Mar 18 '19 19:03 davegw

Please pin to version 6.8.6 until v7 is released. Thanks!

tannerlinsley avatar Apr 23 '19 21:04 tannerlinsley

@tannerlinsley you could publish a 6.9.1 that is a rollback to 6.8.6 so that everyone is fixed, not just the people reporting the issue

MatthewHerbst avatar Apr 23 '19 21:04 MatthewHerbst

I'm doing that right now actually. I plan on releasing a 6.10.0 that is a rollback + some cherry picked commits that are stable.

tannerlinsley avatar Apr 23 '19 21:04 tannerlinsley

Just published a 6.10.0 version.

  • Proceed with caution. This is the result of a rebase so I basically took a scalpel to a bunch of bad commits but kept some of the good ones.
  • This should at least serve as a better base to fix any smaller issues and get back to a stable v6 version.
  • Please open new issues with a [v6] prefix if you find them.

tannerlinsley avatar Apr 23 '19 23:04 tannerlinsley

@tannerlinsley I still see this with 6.10.0. I was able to work around it though by handling the missing values correctly.

AzureMarker avatar May 27 '19 21:05 AzureMarker