I created a site with just one component, and my problem is that the component shows twice
This is my code, from local routes y just get one component and one string valled "formDescription"
In local VSCode its shows OK; just one time
When i upload to AEM instance it duplicated
Image with duplicate div:
I also try with empty render (delete formComponent and all), and the web is empty but the duplicate divs still there:
In "Edit" in my page, there is just one "Layout Container" and one componente inside.
I also check logs, templates config and all i can or kwnown but i dont kwnow why the div is duplicated
Views
Replies
Total Likes
Hi @AdrianFe can you share the screenshot of the tree from your crx de as well? Please go to /content/your_project_name/page_on_which_the_component_is_dropped
Check if there are two components. Delete all if you see two and then try dragging and dropping on the page again.
There can be this case also the same component is already there on the template. Try to drag and drop it on another page created with different template.
Hi @kapil_rajoria,
The element select in blue is the duplicate element, there is one. I will try to check templates but i also check them and i dont see anything bad, i will try to check other things again.
Thanks!!
Hi @AdrianFe please share the tree picture by going to:
http://localhost:4502/crx/de
In this go to the path:
/content/your_project_name/page_on_which_the_component_is_dropped
open the root and containers till your component is visible in the hierarchy.
Now, Check if you can see two component nodes there with same name (ending part could be different).
If there is only a single component there then the issue is related to js only. Some script is rendering it twice.
Only one component "001" ....
But in local its render OK, not duplicate why AEM duplicate if is JS problem?
Thanks a lot!! i will try to check ...
Hi @AdrianFe please replace the component's code to one line of HTML for example: <p>test</p> and check if it gets printed twice.
Also, add console statements to check how many times the code is executed. Please share the info here.
Hi @kapil_rajoria
I will do that soon.
I also check that if i add my component to another site that is working correctly it works and not duplicate
I just add my component here:
And it shows only once and not duplicate. ¿Maybe something different in the site configuration can do the duplication?
Thanks agains!!
@AdrianFe Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Still not found the solution. If i add a simple <div> still duplicate
I found that if i create the SPA inside a "Web React SPA Root Page Template", "PRUEBAROOT" is this component and "pruebaSPA" is "Web React Page Template"
"pruebaSPA" duplicate and "Prueba2" is the same "Web React Page Template" and is not duplicate
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies