Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] react-tabulator 0.13.2 broken when using tabulator 4.8.0 #204

Closed
lifehome opened this issue Sep 9, 2020 · 18 comments
Closed

[Bug] react-tabulator 0.13.2 broken when using tabulator 4.8.0 #204

lifehome opened this issue Sep 9, 2020 · 18 comments

Comments

@lifehome
Copy link

lifehome commented Sep 9, 2020

Title

  • bug: TypeError: Tabulator is not a constructor

Environment Details

  • react-tabulator version: 0.13.2
  • tabulator-tables version: 4.8.0 (thru package.json resolution section)
  • OS: macOS
  • Node.js version: v14.9.0

Description

螢幕截圖 2020-09-09 下午6 45 20

Since the download scope is fixed in tabulator-tables 4.8.0, I attempted to resolve the package into the newer version, yet the error above shown and blocked the entire table rendering.

Related Repository
https://github.com/lifehome/warsinhk-locationtableview

Demo site
This demo site(https://on9.link) is built with react-tabulator 0.13.2, and tabulator-tables 4.7.2.
(Please use Google Translate to comprehend page contents.)
It shows the problem that the green download button cannot export the filtered results, instead it downloads the first page and visible data rows only.

@olifolkerd
Copy link
Collaborator

As of version 4.8 Tabulator now provides ESM module importing as well as standard commonJS require statements.

It is likely a result of your build environment detecting this and using the module import which is then breaking the react-native import.

I may be worth looking at how you require the core Tabulator library in the react native wrapper.

That being said it is entirely possible that there is an issue with the core library, but in my testing i cant seem to replicate this error, would be great to be able to build a test case for this.

Cheers

Oli

@Cyrelc
Copy link

Cyrelc commented Sep 14, 2020

For the record, I am seeing this now as well. I do not explicitly import Tabulator itself anywhere, I only import ReactTabulator from 'react-tabulator' and let this project handle everything else

@rajeshwarKrr
Copy link

I'm also facing this,

I found while debugging like
Ref.current.table is null

When ever we try to use refrences regarding tabulator we r getting this issue.

Regards,
Raj

@rajeshwarKrr
Copy link

This is happening when I use react hooks
Mainly useEffect and useMemo with 0.12.7+ library

New version and now old version is throwing lifecycle error

Please help

@ngduc
Copy link
Owner

ngduc commented Sep 17, 2020

Release 0.13.7
Could you try again ? Please let me know if it works. Thanks.

@FabriceReynolds
Copy link

That's great, now works for me. I was also having this issue.

@rajeshwarKrr
Copy link

rowclick and other events which r using refs are not triggering

@rajeshwarKrr
Copy link

Selectable true or 1 is not triggering any event with this build

Which is effecting most of the table refrences events

@olifolkerd
Copy link
Collaborator

Hey @ngduc

This issue is being caused by the ESM update in Tabulator 4.8.0

In your code where you are requiring Tabulator you need to switch to using an import statement:

import Tabulator from 'tabulator-tables';

Checkout the Upgrade Guide for full details.

Cheers

Oli :)

@ngduc
Copy link
Owner

ngduc commented Sep 21, 2020

Released 0.14.0, fixed.

@twbutler
Copy link

Like others, the react-tabulator tables in our application stopped rendering when tabulator version 4.8.0 came out (react-tabulator at version 0.13.2). After I saw your post about react-tabulator 0.14.0, I upgraded, and the table rendering issue is indeed fixed. However, the ability to click on a row no longer works. There are no warnings or errors - nothing happens when a row is clicked after upgrading to 0.14.0. We are using the rowSelectionChanged option in the options passed to react-tabulator.

@rajeshwarKrr
Copy link

Yes as @twbutler said

I observed that in options if we use selectable : 1
we are unable to select a row and do operations on it

@ngduc
Copy link
Owner

ngduc commented Sep 22, 2020

@twbutler @rajeshwarKrr Thanks for reporting. I tracked down to a recent PR that somehow broke it.
fixed in 0.14.1, please let me know if it still doesn't work. Thanks!

@rajeshwarKrr
Copy link

Super @ngduc all tests running perfectly in my code

Thanks 😌 stay safe

@joaodlf
Copy link

joaodlf commented Sep 22, 2020

Unsure if related, but I just upgraded from 0.12.7 -> 0.14.1, I am simply getting TypeError: tabulator_tables_1.default is not a constructor. No other code was changed, still importing ReactTabulator and using as mentioned in the documentation. (react version 16.13.1)

@twbutler
Copy link

Just tried 0.14.1 also, and it fixes the row click issue in my project! Thanks, @ngduc !

@ngduc
Copy link
Owner

ngduc commented Sep 22, 2020

@joaodlf try to clear cache or redownload dependencies (or try in Codesandbox). That was fixed for me and others.
Let's open a new issue if that still doesn't work. Thanks.

@ngduc ngduc closed this as completed Sep 22, 2020
@joaodlf
Copy link

joaodlf commented Sep 22, 2020

@joaodlf try to clear cache or redownload dependencies (or try in Codesandbox). That was fixed for me and others.
Let's open a new issue if that still doesn't work. Thanks.

You were right! npm cache clean --force did the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants