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.

ReferenceError in RowManager.prototype.redraw when global `self` is not defined

See original GitHub issue

ReferenceError is occured in RowManager.prototype.redraw when global variable self is not defined.

https://github.com/olifolkerd/tabulator/blob/90146917a84e017402b1eb016a51497d1f986a72/src/js/row_manager.js#L1652-L1663

Tabulator Info 4.3.0

Working Example

This code is executing on Node.js.

const jsdom = require("jsdom");
const Tabulator = require('tabulator-tables');

const dom = new jsdom.JSDOM(`<html>
<body>
<div id="example-table"></div>
</body>
</html>`);

const window = global.window = dom.window;
global.Event = window.Event;
global.document = window.document;
global.navigator = window.navigator;

const table = new Tabulator("#example-table", {
    height: 205,
    data: [
        {id: 1, name: "Oli Bob", age: "12", col: "red", dob: ""},
    ],
    layout: "fitColumns",
    columns: [
        {title: "Name", field: "name", width: 150},
        {title: "Age", field: "age", align: "left", formatter: "progress"},
        {title: "Favourite Color", field: "col"},
        {title: "Date Of Birth", field: "dob", sorter: "date", align: "center"},
    ]
});

table.redraw(false);
// ReferenceError: self is not defined

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aklavercommented, Aug 7, 2019

Alright that helps. Changing:

if(self.renderMode == "classic"){ 
to 
if(self.renderMode == "classic"){ 
     self = this;

seems to make this go away. Will create a PR for this.

0reactions
olifolkerdcommented, Aug 11, 2019

@aklaver has fixed this, it will be included in todays release

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Why am I getting ReferenceError: self is not defined ...
The error occurs because the library requires Web APIs to work, which are not available when Next.js pre-renders the page on the server-side ......
Read more >
Uncaught reference error: [something defined] is not defined
Can someone explain to me why this is returning an uncaught reference error? // initialize code called once per entity RotateRing.prototype.
Read more >
ReferenceError: self is not defined - Blockcerts Forum
Hi all, I am running the server.js sample code for NodeJS and I get the following error:
Read more >
Browse Repository :: Bonobo Git Server
node_modules/dom-helpers/events/index.js","webpack:///./node_modules/object-assign/index.js","webpack:///(webpack)/buildin/global.js","webpack:///.
Read more >
Python NameError: name 'self' is not defined Solution
“self” must be listed as an argument for it to be accessible in a method. “self” is not a global variable. It is...
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