gatanaso/multiselect-combo-box-flow

Exception when I update Vaadin to 14.3.0.alpha1

jcgueriaud1 opened this issue · 4 comments

If I tried to vaadin 14.3.0.alpha1, I've got an error.
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "vaadin-combo-box-item" has already been used with this registry
at eval (webpack-internal:///../node_modules/multiselect-combo-box/node_modules/@vaadin/vaadin-combo-box/src/vaadin-combo-box-item.js:189:16)

I think it's because of this error (You can see here a ticket vaadin/flow#8475):
2020-06-05 15:53:46.023 INFO 94148 --- [ main] dev-webpack : Running webpack to compile frontend resources. This may take a moment, please stand by...
2020-06-05 15:53:49.740 ERROR 94148 --- [ webpack] dev-webpack : ERROR in @vaadin/vaadin-combo-box
2020-06-05 15:53:49.797 ERROR 94148 --- [ webpack] dev-webpack : Multiple versions of @vaadin/vaadin-combo-box found:
2020-06-05 15:53:49.797 ERROR 94148 --- [ webpack] dev-webpack : 5.1.1 ../multiselect-combo-box//@vaadin/vaadin-combo-box from ../multiselect-combo-box//@vaadin/vaadin-combo-box/src/vaadin-combo-box-light.js
2020-06-05 15:53:49.798 ERROR 94148 --- [ webpack] dev-webpack : 5.2.0-alpha1 ...~/@vaadin/vaadin-combo-box from /Users/jean-...@vaadin/vaadin-combo-box/src/vaadin-combo-box.js

So perhaps there is a error with a frontend dependency, if I can find a solution I will post it here :).

Steps to reproduce:
Run a project in version 14.3.0.alpha1 with a combobox and a multicombobox

Hi @jcgueriaud1,

Thanks for raising this issue. As you have suggested, it could be due to errors in the frontend dependencies and multiple versions being used. Were you able to get information on which version of vaadin-combo-box it resolves to?
My assumption is that Vaadin 14.3.0.alpha1 uses alpha dependencies and downloads a different version of the vaadin-combo-box than the MultiselectComboBox (which pulls in the latest stable version) thus causing this error.

I believe once the Vaadin 14.3.x release becomes stable, this issue will disappear. For example, have a look at: gatanaso/multiselect-combo-box#66 (comment)

BR,
Goran

Hi,

Perhaps it will be solved when Vaadin 14.3 will use a stable version of Vaadin Combobox. I will re-try it once it's done and add a comment if it's working :).

As a workaround, you can use pnpm instead of npm, that solves the issue even in alpha.

Hi,

I will re-try it once it's done and add a comment if it's working :)

Thank you, I really appreciate it.

As a workaround, you can use pnpm instead of npm, that solves the issue even in alpha

Great, I did not know this. Thank you for sharing, hopefully it will help others in the future if they stumble upon this issue.

It's working in Vaadin 14.3.0.

Probably an error because vaadin-combobox for 14.3.0.alpha was in alpha.