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.

Dynamic loading of a web component fails with 'Error Application ROOT-2521314 already initialized'

See original GitHub issue

Description of the bug

I’ve implemented dynamic loading of a Vaadin exported web component inside a Vaadin 23.2 view, the respective commit is here: https://gitlab.com/mrts/vaadin-embedding-example-guestbook/-/commit/b091d08c1038264f25b6f2c725652297852494ce.

The custom element is loaded and registered successfully, but rendering fails with the error Application ROOT-2521314 already initialized:

Loading custom element guest-book   dynamic-webcomponent-loader.ts:37:16
registering <guest-book> using id GuestBook-0   guest-book.js:112:13
Processing time was 2ms   FlowClient.js:205:19
Uncaught Error: Application ROOT-2521314 already initialized
    initApplication   FlowBootstrap.js:93

Expected behavior

When I open http://localhost:8080/dynamic-loader and click the Load web component button, then the web component is loaded and displayed on the page, the same way as in http://localhost:8080/basic.html.

Minimal reproducible example

See https://gitlab.com/mrts/vaadin-embedding-example-guestbook.

Run the project using mvn jetty:run and open http://localhost:8080/dynamic-loader in the browser to test.

Versions

  • Vaadin / Flow version: 23.2.9
  • Java version: 11
  • OS version: Ubuntu 22.04
  • Browser version (if applicable): Firefox 107
  • Application Server (if applicable): Jetty

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Artur-commented, Nov 30, 2022

With #15315 the embedding seems to work fine

0reactions
mcollovaticommented, Nov 30, 2022

The fix seems to work well. However, I see continuous web socket disconnections, but I don’t have yet understood if it is an issue with jetty version in use or if it is somehow related to the test project code

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vaadin - Bountysource
The custom element is loaded and registered successfully, but rendering fails with the error Application ROOT-2521314 already initialized :
Read more >
Web Component: Dom Exception: This name has already ...
Error : A custom element with name 'slim-repeat' has already been defined. This error seems to be caused by two third-parties trying to...
Read more >
ActiveX component (EmiratesID) fails to initialize - OutSystems
Hi, https://sathishv10.outsystemscloud.com/IDCard/ I'm trying to read Data from National ID card (EmiratesID) via ActiveX EIDA_ZF_ActiveX.
Read more >
Dynamically Loading Components with Angular CLI
When moving from a multi-page application to a SPA, one of the problems that presents itself is the payload size upon initial load....
Read more >
What happened to web components? - LogRocket Blog
Some developers say web components have already died, while others think they're the future of web development.
Read more >

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