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

Polymer 2.3.1: Uncaught TypeError: Cannot read property 'parentNode' of undefined #4986

Closed
1 of 6 tasks
simonfuhrmann opened this issue Dec 12, 2017 · 1 comment
Closed
1 of 6 tasks
Assignees

Comments

@simonfuhrmann
Copy link
Contributor

simonfuhrmann commented Dec 12, 2017

With Polymer 2.3.1, I get the following error message. Downgrading to Polymer 2.3.0 resolves the issue.

Uncaught TypeError: Cannot read property 'parentNode' of undefined
    at processElementStyles (element-mixin.html:431)
    at Function._finalizeTemplate (element-mixin.html:650)
    at HTMLElement._initializeProperties (element-mixin.html:591)
    at HTMLElement._initializeProperties (legacy-element-mixin.html:163)
    at new PropertyAccessors (property-accessors.html:147)
    at new TemplateStamp (template-stamp.html:121)
    at new PropertyEffects (property-effects.html:1134)
    at new PolymerElement (element-mixin.html:559)
    at new GestureEventListeners (gesture-event-listeners.html:46)
    at new Dir (dir-mixin.html:130)

Description

After updating my project to Polymer 2.3.1, the project stopped working with the above error message. In the mentioned location element-mixin.html:431, the variable templateStyle is undefined, because templateStyles is an empty node list.

Expected Results

No JS error.

Actual Results

JS error.

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • Polymer: v2.3.1
  • webcomponents: v1.0.20
@dfreedm
Copy link
Member

dfreedm commented Dec 12, 2017

Looks like this can only happen if you use <link rel="import" type="css"> without having a style in the template

dfreedm added a commit that referenced this issue Dec 12, 2017
Fix case where `<link rel="import" type="css">` is the only styling for
an element

Fixes #4986
fanthos added a commit to fanthos/home-assistant-polymer that referenced this issue Dec 13, 2017
Fix bower.json version string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants