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.

moment is not defined at tabulator.js

See original GitHub issue

Describe the bug

moment is not defined at tabulator.js:14533:8 

Tabulator Info

  • Which version of Tabulator are you using? 4.1.3
  • Post a copy of your construct object if possible so we can see how your table is setup
<link href="/css/tabulator.css" rel="stylesheet">
<script type="text/javascript" src="/js/tabulator.js"></script>

<div id="example-table"></div>

<script type="text/javascript">
	var table = new Tabulator("#example-table", {
		height: "25rem",
		ajaxURL: "/config",
		layout:"fitColumns",
		placeholder:"No Data Available",
		columns: [
			{ title: "id",   field: "id"   },
			{ title: "docn", field: "docn" },
			{ title: "ctime", field: "ctime", formatter:"datetime",
			},
		],
	});
</script>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
jcramirezcommented, Jan 24, 2020

Hi I just had this issue. This is how I fixed it.

  1. npm i moment
  2. I am using electron so I had to this:
const moment = require('moment')

/* 
tabulator expects moment to be globally available and this is not the case in latest version of moment, as I understand. So I had to add it to the window object. That fixed the issue. 
*/
window.moment = moment

Hope that helps.

1reaction
amartiniscommented, Nov 29, 2019

@KES777 I didn’t tag you on my previous reply. Regards!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues including Moment.js library for use with Tabulator in ...
I receive the error: "Uncaught (in promise) Reference Error: moment is not defined at Format.datetime (tabulator.js?ab1f:14619)" I am able to ...
Read more >
Quickstart Guide - Tabulator
A simple guide to get you setup and building your first table.
Read more >
Vue.js + Vuetify + Tabulator [001] - JSitor
FIX TABULATOR MOMENT IS NOT DEFINED */. // window.moment = moment;. Vue.config.productionTip = false;. Vue.config.devtools = false;. console.clear();.
Read more >
Tabulator Tables - KVision Guide - GitBook
KVision Tabulator component is based on awesome Tabulator library. It allows you to create interactive and reactive tables, with advanced sorting, ...
Read more >
Tabulator Javascript Datagrid Integration - Anvil Works
Primarily, my grid is not driven by table data but a custom object with arrays of dicts from which I need to dynamically...
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