question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PolymerPass: properties: {'declaredInQuotes'} aren't found

See original GitHub issue

contents of x-blah.js:

Polymer({
  is: 'x-blah',
  properties: {'counter': Number},
  count: function() { this.counter++; },
});

command used to invoke compiler.jar

$ java -jar compiler.jar --checks_only --polymer_pass --externs polymer-1.0.js --jscomp_error=checkTypes x-blah.js

output

x-blah.js:4: ERROR - Property counter never defined on XBlahElement
  count: function() { this.counter++; },
                           ^^^^^^^

1 error(s), 0 warning(s), 90.9% typed

Removing the quotes around 'counter' fixes the issue.

The fix probably involves which Node name is passed to MemberDefinition when extracting from the properties Object - PolymerPassStaticUtils.java:120

/cc @rictic @jklein24 @MatrixFrog

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MatrixFrogcommented, Jul 31, 2017

No, I think I’d prefer to leave it as it is, so that people don’t write any more quoted properties between now and when they switch to v2

0reactions
danbeamcommented, Aug 2, 2017

note: the issue Chrome hit involved having already quoted properties that were broken by changes in PolymerPass. here’s hoping folks that hit this issue find this thread / figure it out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Declare Properties - Polymer Project
You can declare properties on an element to add a default value and enable various features in the data system. Declared properties can...
Read more >
Declared properties - Polymer 1.0
You can declare properties on your custom element by adding them to the properties ... If the attribute is absent, the property gets...
Read more >
Passing attribute values to properties not working in Polymer ...
By connectedCallback time all attributes have been deserialized to their properties as long as they were defined in the properties block. See ...
Read more >
Properties attributes in Polymer | Mickaël Derriey's blog
Boolean properties are special because the way Polymer treats them is the following: the attribute will exist only if the value is true...
Read more >
Polymer 1.0: How to pass an argument to a Polymer function ...
But in reality, if not using the dataset property and doing it the way I did, you get better backward compatibility. – Amit....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found