Scheduler not loading in production build
gpsfl opened this issue · 2 comments
gpsfl commented
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
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
stefanuebe commented
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](https://private-user-images.githubusercontent.com/36725474/312706061-8c3927b2-2daf-4728-886f-2b207d40d3a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMjY2MDksIm5iZiI6MTcyMjAyNjMwOSwicGF0aCI6Ii8zNjcyNTQ3NC8zMTI3MDYwNjEtOGMzOTI3YjItMmRhZi00NzI4LTg4NmYtMmIyMDdkNDBkM2ExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDIwMzgyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTliZTQ2NjQzZDAzN2Y3ZTY3MTY3OGJkMDJjOTJjYzljZTYxYzExZGE4MmI1ZjRiNjliYTI1NWI5MWNkZWE1YWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9wI8UG6AfX2voG7Z_aQLWe1lH5O8kDuKIi9Y5vDCTp8)
Two things to check / try:
- 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
- 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.
gpsfl commented
We aren't using spring, it's a plain old java servlet web app with maven.
Adding @Uses(FullCalendarScheduler.class)
fixed it for us