Tabulator: typeError: Tabulator is not a constructor

Created on 9 Sep 2020  路  6Comments  路  Source: olifolkerd/tabulator

Describe the bug
React-Tabulator is used as mentioned in http://tabulator.info/docs/4.1/frameworks#react

Tabulator Info

issue is reproducible in v4.8 but not in v4.7.2

Working Example
I'm unable to upload a codepen example at this moment. Will update this as soon as possible.

To Reproduce
Use react-tabulator with tabulator-tables' version 4.8 in a react project, the error comes up. npm automatically pushed me to 4.8 as react-tabulator is compatible with 4.7.2 and greater. I uninstalled 4.8 and backported to 4.7.2 my tables are rendering via react-tabulator now.

Possible Bug

Most helpful comment

Hey @exetico

This is due to the ESM updates in 4.8.0

The Upgrade Guide in the documentation explains that you have to replace your old require statement with an import statement:

var Tabulator = require('tabulator-tables');

Should be replaced with:

import Tabulator from 'tabulator-tables';

I hope that helps,

Cheers

Oli :)

All 6 comments

Hey @nikhilakjoshi

This issues list is only for updates to the Tabulator core library. If you are having an issue with React Tabulator, please raise it on their issue list

Cheers

Oli :)

Hi,
The same happened to me on Vue.

Hey @davidias2004

If you believe this is unrelated to the react native wrapper then i would be happy to look into it further, but someone will have to provide me with a JS fiddle that demonstrates the issue in order for me to get to the bottom of the problem.

Cheers

Oli :)

Damn.. I've tried to get this to work for more than an hour. I thought i made some kind of dump mistake in the way I was loading the component. But i can confirm that something is not working as it did....

@olifolkerd Here's one with tabulator-tables 4.7.2 - which is working fine.
https://codesandbox.io/s/bootstrap-vue-4k89l?file=/src/main.js

Here's one with tabulator-tables 4.8.1, which reporting the issue mentioned by OP.
https://codesandbox.io/s/bootstrap-vue-forked-v2snr?file=/src/main.js

image

Hey @exetico

This is due to the ESM updates in 4.8.0

The Upgrade Guide in the documentation explains that you have to replace your old require statement with an import statement:

var Tabulator = require('tabulator-tables');

Should be replaced with:

import Tabulator from 'tabulator-tables';

I hope that helps,

Cheers

Oli :)

@olifolkerd: you missed to replace var Tabulator = require('tabulator-tables'); in http://tabulator.info/docs/4.8/quickstart

cheers, udo

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mindcreations picture mindcreations  路  3Comments

yaxino picture yaxino  路  3Comments

andreivanea picture andreivanea  路  3Comments

KES777 picture KES777  路  3Comments

soo1025 picture soo1025  路  3Comments