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

Error in Using custom elements page sample code #26411

Closed
crysaro opened this issue Apr 25, 2023 · 1 comment
Closed

Error in Using custom elements page sample code #26411

crysaro opened this issue Apr 25, 2023 · 1 comment
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@crysaro
Copy link

crysaro commented Apr 25, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#customized_built-in_elements

What specific section or headline is this issue about?

Customized built-in elements

What information was incorrect, unhelpful, or incomplete?

The demo on

https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#customized_built-in_elements

throws the following error;

Uncaught TypeError: Illegal constructor.

What did you expect to see?

It should not throw an error

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

the link to github in the docs show different code https://github.com/mdn/web-components-examples/blob/main/expanding-list-web-component/main.js

When I replace:

super(); wiith

self = super();

I get Uncaught ReferenceError: must call super constructor before using 'this' in derived class constructor

Tested in Chrome and FF in mac

@crysaro crysaro added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 25, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Apr 25, 2023
@crysaro crysaro closed this as completed Apr 25, 2023
@crysaro
Copy link
Author

crysaro commented Apr 25, 2023

sorry about this

I missed the , { extends: "ul" } in the customElements.define

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant