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

HTMLMetaElement throw TypeError: Illegal constructor #183

Closed
amrgetment opened this issue Feb 21, 2024 · 5 comments
Closed

HTMLMetaElement throw TypeError: Illegal constructor #183

amrgetment opened this issue Feb 21, 2024 · 5 comments

Comments

@amrgetment
Copy link

amrgetment commented Feb 21, 2024

In Flutter 3.19 I tried web 0.4.2 and I got the following error TypeError: Illegal constructor
when I used HTMLMetaElement

  final HTMLMetaElement metaElement = HTMLMetaElement()
    ..name = 'google-signin-client_id'
    ..content = flavor.googleWebClientId;

similar issues:
#124
flutter/flutter#139125

@srujzs
Copy link
Contributor

srujzs commented Feb 21, 2024

This is actually a duplicate of #53 and not the other issue - the way to instantiate Elements is document.createElement(<name_of_element_tag>) e.g. document.createElement('meta'). There's a different request to autogenerate such syntax (or stop generating Element constructors since they're broken) for each Element, and that'll likely be the solution for #53.

@amrgetment
Copy link
Author

@srujzs I wonder why web team decided to use createElement for all tags?
document.createElement('meta') vs MetaElement

@kevmoo
Copy link
Member

kevmoo commented Feb 22, 2024

@amrgetment – the decision is to just ship what the standard IDL gives us (for now). We have a BUNCH of extra stuff in dart:html to make things easier. We're going slow adding these helpers and extra things to pkg:web.

@amrgetment
Copy link
Author

@kevmoo Great in the future we will use Flutter as HTML 😂
HTML(
body: Column(children: [ImgElement(src:'url'), ])
)

😂😂😂

@srujzs
Copy link
Contributor

srujzs commented Feb 29, 2024

FYI - this is addressed in #185 and should be in the next version release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants