Polymer: Cannot read Property` localName` of undefined

Created on 16 Mar 2017  路  8Comments  路  Source: Polymer/polymer

Description

Steps to Reproduce

Expected Results

Serve The demo pages

Actual Results

Uncaught TypeError: Cannot read property 'localName' of undefined

Browsers Affected

  • [x] Chrome
  • [x] Firefox
  • [x] Edge
  • [x] Safari 9
  • [x] Safari 8
  • [x] IE 11

Versions

  • Polymer: v2.0.0.0rc.1
  • webcomponents: v1.0.0 rc.5
dev-tools extension needs investigation

Most helpful comment

v0.0.8 is published with the fix!

All 8 comments

Can you provide more description about how to reproduce this issue?

I got this error too....

Steps to Reproduce

  1. polymer init
  2. Choose second choice (Polymer 2 element template)
  3. polymer serve when I opened the browser (http://localhost:8081)

Expected Results

Show the index page

Actual Results

  1. webcomponentjs-loader.js not found
  2. iron-component-page.html not found

After I fixed this errors, just wrong linking, I got Cannot read property 'localName' of undefined in my developer tools. Maybe this can help how to solve this bug...

I get this error following the steps above. The issue is with https://github.com/PolymerLabs/polydev in polydev/src/document-context/measure-custom-element.js on line 29 (see cb() below) the callback references ShadyCSS (see second snippet) and this is undefined.

The site works in Firefox and Safari just fine; it's a bug with Chrome 56 (and others?).

function makeMeasurement(operation, tagName, counter, cb) {
        const counterSuffix = counter == null ? '' : ` ${counter}`;
        const startMark = `${prefix}start ${operation} ${tagName}${counterSuffix}`;
        const endMark = `${prefix}end ${operation} ${tagName}${counterSuffix}`;
        const measure = `${prefix}${operation} ${tagName}${counterSuffix}`;
        window.performance.mark(startMark);
        try {
            // ERROR #1 - calls connectedCallback() below
            return cb();
        }
        finally {
            window.performance.mark(endMark);
            window.performance.measure(measure, startMark, endMark);
        }
    }

The cb() function actually calls

connectedCallback() {
        if (window.ShadyCSS) {
          // ERROR #2 - this is undefined, naturally
          window.ShadyCSS.styleElement(this);
        }
        this._flushProperties();
      }

Versions

Polymer: v2.0.0.0rc.3
webcomponents: v1.0.0 rc.6
Chrome: 56

Same error occurs when running PSK3 latest RC. Only on chrome (tested on chrome 57)

Remove the "Polymer DevTools Extension" if you had installed such an extension in your Chrome :D

This is now fixed at master in polydev. It looks like the only developer with the credentials to publish the fix is on vacation though. Will update the bug once it's deployed.

Was touched by this issue too, ThX for the fix and following now!

v0.0.8 is published with the fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

masaoliou picture masaoliou  路  3Comments

yordis picture yordis  路  3Comments

nazar-pc picture nazar-pc  路  4Comments

SergRZ picture SergRZ  路  3Comments

alexhx5 picture alexhx5  路  3Comments