rykdesjardins/js-calendar

Uncaught ReferenceError: _jscallog is not defined

Closed this issue ยท 3 comments

Hey, thanks for the awesome project!

Normally id never message a question here, i just cant find anything anywhere regarding your utility!

So i get this weird error, ive had a look around but i just can't figure out whats causing it.

My code looks like: components folder

const JSCalendar = require('vanilla-js-calendar');

exports.init = (function() {

  const obj = {
    dom: {
      cal: document.getElementById('Cal')
    }
  }

  const create = () => {
    const cal = new JSCalendar(obj.dom.cal, {}).init().render();
  }

  return { createCal };

})();

From my index.js

const Calendar = require('../components/Calendar').init;

window.onload = function() {

  Calendar.create();
    
}

Any idea why im getting that error?

FYI running node: v1.6.2
I used yarn add vanilla-js-calendar

Thanks in advance!

Hi,

Thanks for the kind words! I've identified the issue, and I gotta say it's a pretty interesting one. Apparently, Babel transformed one of the global scope method weirdly.

/dist/js-calendar.js, Line 11

_jscallog = function _jscallog(msg) {

Should read
var _jscallog = function(msg) { or function _jscallog(msg) {

I will try to push a fix as soon as possible.

Please note I don't actively maintain this library and honestly wouldn't suggest using it in a big production environment :)

Anytime :), aha that is interesting, thank you for replying then ๐Ÿ‘

It's a shame i haven't found any other ones that are just pure js!

Thanks again :)

I've pushed a working version and updated the distribution files.

NPM and bower should update in no time :) Thanks for reporting this!

Closing this issue, now.