We are using Vaadin Fusion, and are stuck for the time being with version 19. In this version it is not possible to add an NPM dependency that itself depends on Vaadin components.
E.g. if I have an app's package.json
like this:
{
"dependencies": {
"my-beautiful-button": "0.0.1",
"@polymer/iron-icon": "3.0.1",
"@polymer/iron-list": "3.1.0",
"@polymer/polymer": "3.2.0",
"@vaadin/flow-frontend": "./target/flow-frontend",
"@vaadin/form": "./target/flow-frontend/form",
"@vaadin/router": "1.7.2",
...
and my-beautiful-button
has a package.json
like this
{
"dependencies": {
"vaadin/vaadin-button": "2.4.0",
...
the app will compile fine and start with Spring-boot and webpack-dev-server, but in the browser console an exception somewhat like this will be thrown:
Failed to execute 'define' on 'CustomElementRegistry': the name "vaadin-lumo-styles" has already been used with this registry
This is reproducible with apps based on Vaadin up to version 20.0.5. Now with Vaadin 20.0.6 this is fixed and "my-beautiful-button" shows up fine in the browser. But for the life of me I can't seem to find out what caused the change in the Vaadin code base.
Is there something I can do to have this behavior in Vaadin versions prior to 20.0.6?