question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Failed to execute 'define' on 'CustomElementRegistry'" (14.6.0.alpha1)

See original GitHub issue

Description 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:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, Apr 7, 2021

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.

0reactions
vaadin-botcommented, Apr 19, 2021

This ticket/PR has been released with platform 14.6.0.beta2. For prerelease versions, it will be included in its final version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found