Could there be an issue with the production build of the component? The component seems to work as expected in development, but in production builds it fails with the error message "Uncaught (in promise) TypeError: theme.register is not a function" in the browser console. The application's main page remains white and the Vaadin progress bar indicates the page is still loading...
The error is triggered by the following code:
theme=document.createElement("dom-module"); theme.id="vcf-autosuggest-lumo"; theme.setAttribute("theme-for","vcf-autosuggest"); theme.innerHTML=` <template> <style> :host {} </style> </template> `; theme.register(theme.id); <== Triggers the error!
I'm using the following versions:
- autosuggest : 1.2.0
- JDK 11
- Vaadin 23.2.6
- Spring Boot 2.6.5
Attached you will find a ZIP file containing a Spring Tools Suite project to reproduce the behaviour. Running the imported project from STS shows the autosuggest component as expected.
Building a docker image using the provided Dockerfile by running the command "docker build -t vaadin-autosuggest:1.0.0 ." followed by executing a corresponding container using the command "docker run --rm -it -p 8080:8080 --name test vaadin-autosuggest:1.0.0" results in the mentioned error when opening the browser at "http://localhost:8080/"
Thank you for your feedback.
Kurt