stefanuebe/vaadin-fullcalendar

Scheduler not loading in production build

gpsfl opened this issue · 2 comments

Bug Description

A calendar with scheduler active doesn't load in productions builds. It works using the dev server.

The same code has worked with version vaadin-fullcalendar 4.x, but after ugprading to 6.x it doesn't work anymore.

There are no warnings/errors in javascript console or in the server log.

Vaadin version 24

Dev:
image

Production:
image

Example Code

FullCalendar calendar = FullCalendarBuilder.create().withScheduler().build();

((Scheduler) calendar).setSchedulerLicenseKey("GPL-My-Project-Is-Open-Source"); // Use GPL key for testing, we also have a license key

calendar.setSizeFull();
calendar.changeView(RESOURCE_TIMELINE_DAY);

add(calendar); // Add to some layout

I tried to reproduce your issue, but it works for me. Since the demo also works, I assume it might be something with your project setup or configuration.

This is my result when adding your snippet to my demo as a new, empty view (using a vertical layout).

image

Two things to check / try:

  1. Please check, that the addon package is added to the whitelist package, if you use a Spring project. https://github.com/stefanuebe/vaadin-fullcalendar/wiki/FAQ
  2. Maybe the component is referenced indirectly and the package scanner cannot determine the usage of your component and thus the FC and simply strips the respective scripts from the packages. In that case I would expect error messages, but just to be sure, you could add a @Uses(FullCalendarScheduler.class) to you AppShellConfigurator or main router layout. This should then make Vaadin also scan and include the addon classes.

We aren't using spring, it's a plain old java servlet web app with maven.

Adding @Uses(FullCalendarScheduler.class) fixed it for us