fullcalendar: Calling 'setOption' when there is a date selection causes a typeerror

Hello,

An error occurs when changing an option value with setOption in (or just after in my case) the select handler.

It does not occur when switching date or view first.

How to reproduce Select any timeslot.

https://codepen.io/crocteamgg/pen/MWwjXRB?editors=0010

Stacktrace on my server (nothing is shown in Codepen):

main.js?v=2.1.2:8525 Uncaught TypeError: Cannot read property 'calendar' of undefined
    at t.Slicer._sliceDateSpan (main.js?v=2.1.2:8525)
    at t.sliceDateSelection (main.js?v=2.1.2:1558)
    at t.Slicer.sliceProps (main.js?v=2.1.2:8452)
    at t.render (main.min.js?v=2.1.2:6)
    at t.Component.receiveProps (main.js?v=2.1.2:3957)
    at r.render (main.min.js?v=2.1.2:6)
    at r.Component.receiveProps (main.js?v=2.1.2:3957)
    at CalendarComponent.renderView (main.js?v=2.1.2:6304)
    at CalendarComponent.render (main.js?v=2.1.2:6168)
    at CalendarComponent.Component.receiveProps (main.js?v=2.1.2:3957)

Info Using version 4.4.0 without Scheduler Does not happen in version 4.3.0

Have a nice day

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 12
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I had the same error. Finally, change all related fullcalendar plugins to 4.3.0 version

"@fullcalendar/core": "4.3.0",
"@fullcalendar/daygrid": "4.3.0",
"@fullcalendar/interaction": "4.3.0",
"@fullcalendar/react": "4.3.0",
"@fullcalendar/timegrid": "4.3.0",

v4.4.1 has just been released and contains a fix. please upgrade all installed fullcalendar packages. if you need a list of the packages that are upgradeable:

  4.4.1 @fullcalendar/resource-common
  4.4.1 @fullcalendar/resource-daygrid
  4.4.1 @fullcalendar/resource-timegrid
  4.4.1 @fullcalendar/core
  4.4.1 @fullcalendar/daygrid
  4.4.1 @fullcalendar/timegrid

4.3.0 works for me too.

Ahh sorry, yes downgrade did work (damn npm), 4.3.0 is functional for me.

I get the same error on 4.4.0 when I’m not using the rerenderDelay prop in React.

I did a quick git bisect to figure out what caused this. This bug was introduced by https://github.com/fullcalendar/fullcalendar/commit/7299ea333c0b9216f4784d8ff7d197c38deeb5a9