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

Preventable runtime error caused by setAttribute '' #179

Closed
pfiadDi opened this issue Mar 21, 2022 · 2 comments
Closed

Preventable runtime error caused by setAttribute '' #179

pfiadDi opened this issue Mar 21, 2022 · 2 comments

Comments

@pfiadDi
Copy link

pfiadDi commented Mar 21, 2022

This causes a runtime error loop:

Html.Attributes.attribute "" ""

The error:
Main.elm:2872 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '' is not a valid attribute name. at _VirtualDom_applyAttrs (http://localhost:5000/index.975ef6c8.js:2497:52)

This could be prevented by the compiler by not accepting empty "" as attribute arguments

@pfiadDi
Copy link
Author

pfiadDi commented Mar 21, 2022

Same issue as #141

@evancz
Copy link
Member

evancz commented May 12, 2022

The compiler does not check specific values. It only checks types like String and Int, not whether a specific function gets "" or "abc" or whatever else. I believe there are other compilers that do that sort of thing though.

Anyway, we can track this one with #141. Thank you for the report!

@evancz evancz closed this as completed May 12, 2022
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

2 participants