Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate HTML when using prerender and shared components used in both SSR pages and templates #1044

Closed
thescientist13 opened this issue Jan 15, 2023 · 0 comments · Fixed by #1212 · May be fixed by #1208
Closed

duplicate HTML when using prerender and shared components used in both SSR pages and templates #1044

thescientist13 opened this issue Jan 15, 2023 · 0 comments · Fixed by #1212 · May be fixed by #1208
Assignees
Labels
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Jan 15, 2023

Type of Change

Bug

Summary

So had an issue where I was creating some icon based components and using it both in my page.js and my template.html, which is leading to duplicate SSR content in the page when building.

Screen Shot 2023-01-15 at 5 49 05 PM

Details

You can see in the linked PR, I have a component that is being used in both the index.js of the project and through a component that is used in the app.html template.

// my-component.js
export default MyComponent extends HTMLElement { }
// pages/index.js
import './my-component.js
<!-- templates/app.html -->
<!DOCTYPE html>
<html lang="en" prefix="og:http://ogp.me/ns#">
  <head>
    <script type="module" data-gwd-opt="static" src="../components/my-component/my-componentjs"></script>
  </head>

  <body>
      <page-outlet></page-outlet>   
      <my-component></my-component>
   </body>
</html>

Which is the same outcomes observed trying to fix #988


I would say this issue takes precedence over #988 since while the warnings are there, everything is working. So solving for this seems paramount, and if we can solve 988 too great, otherwise we can circle back to it after solving this one.

@thescientist13 thescientist13 added the bug Something isn't working label Jan 15, 2023
@thescientist13 thescientist13 self-assigned this Jan 15, 2023
@thescientist13 thescientist13 added this to the 1.0 milestone Jan 15, 2023
@thescientist13 thescientist13 changed the title duplicate HTML when using prerender and shared components used in both pages and templates duplicate HTML when using prerender and shared components used in both SSR pages and templates Dec 27, 2023
@thescientist13 thescientist13 mentioned this issue Mar 9, 2024
37 tasks
@thescientist13 thescientist13 linked a pull request Mar 16, 2024 that will close this issue
20 tasks
@thescientist13 thescientist13 linked a pull request Jun 22, 2024 that will close this issue
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
1 participant