fullcalendar: Solution for "Cannot read property 'isHiddenDay' of undefined"
The JS error Cannot read property 'isHiddenDay' of undefined happens when there are multiple instances of the @fullcalendar/common package present in the same build. This is not the fault of the end-developer. After all, @fullcalendar/common is an internal-only package that nobody explicitly installs themselves.
How to solve this?: guarantee that all plugins are using the same @fullcalendar/common package by having @fullcalendar/core (the package the requires common) always be a peerDependency. It is already a peerDependency for all packages except the following:
@fullcalendar/react@fullcalendar/angular@fullcalendar/vue
Right now, things usually work because most bundlers know to dedup references to the same packages with similar semver strings. However, sometimes the semver strings are not exact. For example ^5.7.0 and ^5.7.1. This frequently happens when we release a patch-level release for only one package, not all. When this happens, bundlers act unpredictably with how they dedup. Using a peerDependency sidesteps this unpredictability.
This will be a breaking change for those three packages. That is why I will wait until v6 to implement this. For the remaining releases of v5, I will avoid the problem by making sure that all packages are always published upon any version bump.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 12
- Comments: 16 (2 by maintainers)
@arshaw I’m using
@fullcalendar/vueplugin, when I update from6.0.2to6.1.0the same issue happened.So here’s how I seem to have fixed it with Next.js. I had the basic React example with
react@5.11.2anddaygrid@5.11.3packages installed. They seemed to import global css files, which didn’t sit well with Next. I found some fix involvingnext-transpile-modules. Runningnpm ls @fullcalendar/commonindicated that there were no problems with deduping. Here’s what I did:@fullcalendar/react@betaand@fullcalendar/daygrid@betanext-transpile-modulesfrom mynext.config.jsI’m quite unfamiliar with Next, so I have no idea why this works, but I won’t complain.
I can fixed error by my self. you need to install @fullcalendar/common@beta in your project.
npm install @fullcalendar/common@beta@vhscom Thank you; I’ll have a look at that this week.
I’m getting this error (
TypeError: Cannot read property 'isHiddenDay' of undefined) with version5.8.0despite all my dependencies matching:Released in v6.0.0
See this part of the release notes: https://fullcalendar.io/docs/upgrading-from-v5#peer-dependencies
This is still happening on version 6
When upgrading to
5.11.0we started seeing the error in this issue using Vue. Below is the output ofnpm ls.conversely 5.10.1 works fine and the package is deduped:
Unfortunatley I don’t know enough about
npm’s deduping to provide a PR resolution.