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

SSR pages using custom HTML element with constructor params returns undefined for compilation object #1402

Open
lschierer opened this issue Jan 31, 2025 · 0 comments
Labels
bug Something isn't working CLI SSR v0.32.0
Milestone

Comments

@lschierer
Copy link
Contributor

when building SSR pages using the "preferred" custom HTML element with constructor params, the second parameter passed to the constructor is supposed to be an instance of Greenwood's compilation object.

create a page (the page may have to be typescript, I did not test with javascript)

export default class Test extends HTMLElement {
  constructor(request: Request, compilation) {
    super();
    console.log(JSON.stringify(compilation));
  }

  connectedCallback() {
    this.innerHTML = `
      <span>Test Page</span>
    `;
  }
}

then start the Greenwood dev server and navigate to it.

You will see

Image
@thescientist13 thescientist13 added bug Something isn't working CLI SSR v0.32.0 labels Feb 3, 2025
@thescientist13 thescientist13 added this to the 1.0 milestone Feb 3, 2025
@thescientist13 thescientist13 changed the title SSR pages using custom HTML element with constructor params SSR pages using custom HTML element with constructor params returns undefined for compilation object Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI SSR v0.32.0
Projects
Development

No branches or pull requests

2 participants