fullcalendar: Uncaught TypeError: Cannot read property 'isHiddenDay' of undefined
I’ve created a Svelte implementation of FullCalendar and I have issues upgrading to v5.
I use rollup as my builder and a postcss plugin for the styles, and tried to follow this guide.
I try to initialize the calendar with these options:
let options = {
initialView: 'dayGridMonth',
plugins: [dayGridPlugin],
};
This is what I get in the browser’s console:
main.js:8102 Uncaught TypeError: Cannot read property 'isHiddenDay' of undefined
at new DaySeriesModel (main.js:8102)
at DayTableView.buildDayTableModel (main.js:1080)
at DayTableView.buildDayTableModel (main.js:983)
at DayTableView.render (main.js:1069)
at T (preact.module.js:1)
at g (preact.module.js:1)
at j (preact.module.js:1)
at T (preact.module.js:1)
at g (preact.module.js:1)
at T (preact.module.js:1)
- This is the component implementation.
- I can’t actually upload a live demo since I need a postcss plugin to handle the css-in-js.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 7
- Comments: 30 (5 by maintainers)
Commits related to this issue
- Fix package resolution for @fullcalendar Fixes #5724 — committed to directus/directus by rijkvanzanten 3 years ago
I have some more insight into the problem. For some reason, when installing
@fullcalendar/coreand the plugins, npm is not deduping@fullcalendar/common. Sometimes there are multiple copies of it, nested within fullcalendar’s other dependencies.@YogliB I was able to clone your repro and reproduce the error. When I reinstalled the deps, making a new lock file, things began to work:
I’m not sure why. I bet that trick will work for others.
I have got exact the same issue,(Cannot read property ‘isHiddenDay’ of undefined) so i searched and ended up here. then I realized that there wasn’t any “@fullcalendar/timegrid”: “^5.1.0”, in my package.json even I installed with npm install @fullcalendar/timegrid. so then I installed with npm install --save @fullcalendar/timegrid (with --save) and made sure that it’s in package.json dependencies, that eventually solved problem.
@arshaw
This is the leanest repro I could have come up with, hope this helps.
Uninstall all @fullcalendar packages Install packages again
make sure all packages version 5.4.0 .
this worked for me
npm uninstall @fullcalendar/daygrid @fullcalendar/reactnpm install --save @fullcalendar/daygrid @fullcalendar/react@arshaw That’s really wierd, based on your solution I solved it by deduping
@fullcalendar/commonin the rollup config file:@irfanonk yes, it works for me. thanks. it saves my times and money 😉