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

in polymer 0.0.20131025 element id attribute not allowed #332

Closed
jeroldangarcia opened this issue Oct 30, 2013 · 4 comments
Closed

in polymer 0.0.20131025 element id attribute not allowed #332

jeroldangarcia opened this issue Oct 30, 2013 · 4 comments

Comments

@jeroldangarcia
Copy link

"id" attribute declaration in a polymer-element now causes an error:

example:
polymer-element name="w5-empty" attributes="id"

error:
TypeError {stack: "TypeError: Cannot read property 'id' of undefined↵…/www.polymer-project.org/polymer.min.js:35:25304)"}
"TypeError: Cannot read property 'id' of undefined
at c.Object.defineProperty.get as id
at c.publishAttributes (http://www.polymer-project.org/polymer.min.js:37:6716)
at f.buildPrototype (http://www.polymer-project.org/polymer.min.js:37:7569)
at f.register (http://www.polymer-project.org/polymer.min.js:37:7341)
at h._register (http://www.polymer-project.org/polymer.min.js:37:9870)
at h.registerWhenReady (http://www.polymer-project.org/polymer.min.js:37:9827)
at h.createdCallback (http://www.polymer-project.org/polymer.min.js:37:9599)
at j (http://www.polymer-project.org/polymer.min.js:35:24719)
at g (http://www.polymer-project.org/polymer.min.js:35:24327)
at Object.p as upgrade"

@jeroldangarcia
Copy link
Author

The same for "title"

@jeroldangarcia
Copy link
Author

I think they do this on porpouse in order to avoid conflicts between the
custom-element attributes and global tag parameters...

On 05/12/13 02:39, Po-Ying Chen wrote:

I have same problem too.


Reply to this email directly or view it on GitHub
#332 (comment).

@dfreedm
Copy link
Member

dfreedm commented Dec 17, 2013

Sorry for letting this issue fall through the cracks.

In general, it's a bad idea to attempt to redefine native DOM attributes like "id".
The reason for this failure is related to how DOM properties are defined, which is very complicated.
Suffice it to say that "id" and properties like it are somewhat magical.

It would probably be beneficial to warn when you accidentally touch one of these properties so at least the error makes sense.

@dfreedm
Copy link
Member

dfreedm commented Dec 17, 2013

I'll close this in favor of #379, which will add warnings for situations like this.

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

Successfully merging a pull request may close this issue.

2 participants