"Failed to execute 'define' on 'CustomElementRegistry'" (14.6.0.alpha1)
See original GitHub issueDescription of the bug / feature
Frontend-UI is completely broken
Versions:
- Vaadin / Flow version: 14.6.0.alpha1
- Java version: 11
- OS version: OSX 10.15.7
- Browser: Chrome 89.0.4389.114 (current version)
After updating from 14.4.4 to 14.6.0.alpha1 for testing the new packaged themes, our app’s frontend is broken. The browser console reports the following error:
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "vaadin-lumo-styles" has already been used with this registry at eval (webpack-internal:///../node_modules/.pnpm/@vaadin#vaadin-lumo-styles@1.6.1/node_modules/@vaadin/vaadin-lumo-styles/version.js:9:16) at Module.../node_modules/.pnpm/@vaadin#vaadin-lumo-styles@1.6.1/node_modules/@vaadin/vaadin-lumo-styles/version.js (http://localhost:8180/VAADIN/build/vaadin-bundle-bfe7ef28df45ff5f8bfb.cache.js:2833:1) at __webpack_require__ (http://localhost:8180/VAADIN/build/vaadin-bundle-bfe7ef28df45ff5f8bfb.cache.js:20:30) at eval (webpack-internal:///../node_modules/.pnpm/@vaadin#vaadin-lumo-styles@1.6.1/node_modules/@vaadin/vaadin-lumo-styles/color.js:2:69) at Module.../node_modules/.pnpm/@vaadin#vaadin-lumo-styles@1.6.1/node_modules/@vaadin/vaadin-lumo-styles/color.js (http://localhost:8180/VAADIN/build/vaadin-bundle-bfe7ef28df45ff5f8bfb.cache.js:2773:1) at __webpack_require__ (http://localhost:8180/VAADIN/build/vaadin-bundle-bfe7ef28df45ff5f8bfb.cache.js:20:30) at eval (webpack-internal:///../node_modules/.pnpm/@vaadin#vaadin-lumo-styles@1.6.1/node_modules/@vaadin/vaadin-lumo-styles/mixins/overlay.js:2:67) at Module.../node_modules/.pnpm/@vaadin#vaadin-lumo-styles@1.6.1/node_modules/@vaadin/vaadin-lumo-styles/mixins/overlay.js (http://localhost:8180/VAADIN/build/vaadin-bundle-bfe7ef28df45ff5f8bfb.cache.js:2785:1) at __webpack_require__ (http://localhost:8180/VAADIN/build/vaadin-bundle-bfe7ef28df45ff5f8bfb.cache.js:20:30) at eval (webpack-internal:///../node_modules/.pnpm/@vaadin#vaadin-overlay@3.5.1/node_modules/@vaadin/vaadin-overlay/theme/lumo/vaadin-overlay-styles.js:2:102)
This hints at a problem with the “vaadin-lumo-styles” package. Running “npx find-duplicate-dependencies” gives the following output:
This package has the following duplicate dependencies:
@vaadin/vaadin-lumo-styles :
[
{
name: '@vaadin/vaadin-lumo-styles',
version: '1.6.0',
from: undefined,
path: 'no-name/@vaadin/vaadin-accordion'
},
{
name: '@vaadin/vaadin-lumo-styles',
version: undefined,
from: undefined,
path: 'no-name/@vaadin/vaadin-core-shrinkwrap'
}
]
Looking into the pnpm-lock.yaml und searching for “vaadin-lumo-styles” reveals 34 results, of which 32 are version 1.6.0 and two are 1.6.1:
/@vaadin/vaadin-core-shrinkwrap/14.6.0-alpha1:
resolution: {integrity: sha512-tq7GH9GgQsGDJ2MrpD5aryy/JdBrMHEbJoSo4Gv+mmweO4VJIffh4QPzLqSaEYeTxaFgq2jxwbGZHpQrBuMzFg==}
dependencies:
[...]
'@vaadin/vaadin-lumo-styles': 1.6.1
[...]
/@vaadin/vaadin-overlay/3.5.1:
resolution: {integrity: sha512-0g+poK/BXF92L2lSKrHMY5rcKzUxCBZNzP/NDwgi4a86nbjL7CAKKZdno7Yl+j8UsTR76nOEw4fAYTFi86B0qg==}
dependencies:
[...]
'@vaadin/vaadin-lumo-styles': 1.6.1
[...]
I’m anything but knowledgeable around the internal workings and the build process of Vaadin’s frontend, but this looks like a dependency problem to me.
I have tried to delete all the config related to the frontend build (package.json, pnpm-lock.yaml, pnpmfile.js, webpack.config.js, webpack.generated.js, node_modules folder) and do a clean-package in maven, to no avail. Our app has only a single @JsModule annotation and the package loaded this way has a very short list of dependencies (pixi.js, typescript) that are not related to anything Vaadin or Polymer at all.
I say thanks in advance for any help resolving this issue 😃
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
As a side effect of pnpm 6 pnpmfile.js rename, Flow creates a file that is not locking the versions anymore. #10576 will fix that too (by not using pnpm 6). Expect fixes land soon to 14.5 and 14.6. I’ll later on ticketize being able to use pnpm 6 too.
This ticket/PR has been released with platform 14.6.0.beta2. For prerelease versions, it will be included in its final version.