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)

Most upvoted comments

@arshaw I’m using @fullcalendar/vue plugin, when I update from 6.0.2 to 6.1.0 the 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.2 and daygrid@5.11.3 packages installed. They seemed to import global css files, which didn’t sit well with Next. I found some fix involving next-transpile-modules. Running npm ls @fullcalendar/common indicated that there were no problems with deduping. Here’s what I did:

  1. Install @fullcalendar/react@beta and @fullcalendar/daygrid@beta
  2. Remove usage of the next-transpile-modules from my next.config.js

I’m quite unfamiliar with Next, so I have no idea why this works, but I won’t complain.

This is still happening on version 6

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 version 5.8.0 despite all my dependencies matching:

$ npm ls @fullcalendar/common
app@1.0.0 /mnt/c/code/app
├─┬ @fullcalendar/adaptive@5.8.0
│ ├── @fullcalendar/common@5.8.0
│ └─┬ @fullcalendar/premium-common@5.8.0
│   └── @fullcalendar/common@5.8.0  deduped
├─┬ @fullcalendar/daygrid@5.8.0
│ └── @fullcalendar/common@5.8.0  deduped
├─┬ @fullcalendar/interaction@5.8.0
│ └── @fullcalendar/common@5.8.0  deduped
├─┬ @fullcalendar/resource-timeline@5.8.0
│ ├── @fullcalendar/common@5.8.0  deduped
│ ├─┬ @fullcalendar/resource-common@5.8.0
│ │ └── @fullcalendar/common@5.8.0  deduped
│ ├─┬ @fullcalendar/scrollgrid@5.8.0
│ │ └── @fullcalendar/common@5.8.0  deduped
│ └─┬ @fullcalendar/timeline@5.8.0
│   └── @fullcalendar/common@5.8.0  deduped
├─┬ @fullcalendar/timegrid@5.8.0
│ ├── @fullcalendar/common@5.8.0
│ └─┬ @fullcalendar/daygrid@5.8.0
│   └── @fullcalendar/common@5.8.0  deduped
└─┬ @fullcalendar/vue@5.8.0
  └─┬ @fullcalendar/core@5.8.0
    └── @fullcalendar/common@5.8.0  deduped

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.0 we started seeing the error in this issue using Vue. Below is the output of npm ls.

> npm ls @fullcalendar/common
+-- @fullcalendar/core@5.11.0
| `-- @fullcalendar/common@5.11.0
+-- @fullcalendar/daygrid@5.11.0
| `-- @fullcalendar/common@5.11.0
+-- @fullcalendar/interaction@5.11.0
| `-- @fullcalendar/common@5.11.0  deduped
`-- @fullcalendar/list@5.11.0
  `-- @fullcalendar/common@5.11.0  deduped

conversely 5.10.1 works fine and the package is deduped:

> npm ls @fullcalendar/common
+-- @fullcalendar/core@5.10.1
| `-- @fullcalendar/common@5.10.1
+-- @fullcalendar/daygrid@5.10.1
| `-- @fullcalendar/common@5.10.1  deduped
+-- @fullcalendar/interaction@5.10.1
| `-- @fullcalendar/common@5.10.1  deduped
`-- @fullcalendar/list@5.10.1
  `-- @fullcalendar/common@5.10.1  deduped

Unfortunatley I don’t know enough about npm’s deduping to provide a PR resolution.