Skip to content
Fix Code Error

Error using core-scaffold from polymer JS in the latest Polymer Dart release

May 5, 2021 by Code Error
Posted By: Anonymous

After hearing that Polymer JS components should work out of the box, which they don’t, I went ahead and tried using some Polymer JS elements in my project.

I needed to remove a few files like demo.html, metadata.html and index.html from all the JS components and replacing with . This is so that the polymer transformer wouldn’t include the unwanted and unneeded files, plus make sure it uses the dart polymer.html file to prevent it being loaded twice.

I included the core-scaffold component, and got this error when running pub serve in the latest Dart Editor.


Build error:
Transform ScriptCompactor on gcanvas|web/index.html threw error: The null object does not have a method '>'.

NoSuchMethodError: method not found: '>'
Receiver: null
Arguments: [7]
dart:core-patch/object_patch.dart 45                                            Object.noSuchMethod
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 99:30           Parser._parseBinary
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 71:72           Parser._parsePrecedence
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 43:52           Parser._parseExpression
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 29:28           Parser.parse
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 12:56           parse
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 524:25  _HtmlExtractor._addExpression
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 509:23  _HtmlExtractor._processNormalElement.<fn>
dart:collection-patch/collection_patch.dart 957                                 _HashMap&&_LinkedHashMapMixin.forEach
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 495:28  _HtmlExtractor._processNormalElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 453:43  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 462:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 32:52                 TreeVisitor.visitDocument
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 16:52                 TreeVisitor.visit
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 187:61  _extractUsesOfMirrors
dart:async/zone.dart 730                                                        _rootRunUnary
dart:async/zone.dart 864                                                        _RootZone.runUnary
dart:async/future_impl.dart 488                                                 _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 571                                                 _Future._propagateToListeners
dart:async/future_impl.dart 555                                                 _Future._propagateToListeners.handleWhenCompleteCallback.<fn>
dart:async/zone.dart 730                                                        _rootRunUnary
dart:async/zone.dart 864                                                        _RootZone.runUnary
dart:async/future_impl.dart 488                                                 _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 571                                                 _Future._propagateToListeners
dart:async/future_impl.dart 331                                                 _Future._completeWithValue
dart:async/future_impl.dart 393                                                 _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 23                                           _asyncRunCallbackLoop
dart:async/schedule_microtask.dart 32                                           _asyncRunCallback
dart:isolate-patch/isolate_patch.dart 128                                       _RawReceivePortImpl._handleMessage

dart:core                                                                       Object.noSuchMethod
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 99:30           Parser._parseBinary
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 71:72           Parser._parsePrecedence
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 43:52           Parser._parseExpression
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 29:28           Parser.parse
http://127.0.0.1:39312/packages/polymer_expressions/parser.dart 12:56           parse
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 524:25  _HtmlExtractor._addExpression
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 509:23  _HtmlExtractor._processNormalElement.<fn>
dart:collection                                                                 _HashMap&&_LinkedHashMapMixin.forEach
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 495:28  _HtmlExtractor._processNormalElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 453:43  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 462:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 39:50                 TreeVisitor.visitElement
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 465:25  _HtmlExtractor.visitElement
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 12:50                 TreeVisitor.visit
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 24:49                 TreeVisitor.visitChildren
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 30:48                 TreeVisitor.visitNodeFallback
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 32:52                 TreeVisitor.visitDocument
http://127.0.0.1:39312/packages/html5lib/dom_parsing.dart 16:52                 TreeVisitor.visit
http://127.0.0.1:39312/packages/polymer/src/build/script_compactor.dart 187:61  _extractUsesOfMirrors
dart:isolate                                                                    _RawReceivePortImpl._handleMessage
Build completed with 1 errors.
[web] GET /index.html => Could not find asset gcanvas|web/index.html.
[web] GET /favicon.ico => Could not find asset gcanvas|web/favicon.ico.

I tracked it down to the component core-header-panel, by excluding, then one by one including components found in core-scaffold, till it failed again.

Does anyone know where is this method ‘>’? And what is null? Unless I want to give up on using core-scaffold, this is a blocker. Anyway pasted below is the contents of the bower.json file and the pubspec.yaml, in case it helps.

pubspec.yaml

name: gcanvas
version: 0.0.5
author: James Hurford
description: Canvasing App for doorknocking campaigns.
environment:
  sdk: '>=1.0.0 <2.0.0'
dependencies:
  browser_detect: any
  csvparser: any
  http: any
  http_server: any
  lawndart: any
  mime: any
  polymer: any
  postgresql: any
  route: any
  uuid: any
dev_dependencies:
  scheduled_test: any
transformers:
- polymer:
    entry_points:
    - web/index.html

bower.json

{
  "name": "gcanvas",
  "version": "0.0.0",
  "authors": [
    "James Hurford"
  ],
  "private": true,
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "x-tag-imports": "x-tag/x-tag-imports",
    "polymer-ui-tabs": "polymer/polymer-ui-tabs#~0.3.0",
    "core-scaffold": "polymer/core-scaffold#~0.3.1"
  },
  "resolutions": {
    "platform": ">=0.3.0 <1.0.0"
  }
}

Thanks

Solution

From looking at the code where the exception was thrown it seems the Polmyer transformer tries to process the HTML file and the binding expressions.
This looks like a bug or missing feature in polymer_expressions and possible the Dart Polymer transformer. I suspect this code in polymer-header-panel <div id="mainContainer" flex?="{{mode !== 'cover'}}" on-scroll="{{scroll}}"> is causing the exception at the unknown operator !==

Answered By: Anonymous

Related Articles

  • Error 'Map', but got one of type 'Null' flutter web with…
  • The null object does not have a method []=
  • How do you create a custom neon animation in Dart
  • Multipart File Upload Using Spring Rest Template + Spring…
  • Flutter: RenderBox was not laid out
  • Using less in a polymer-dart application
  • Polymer core-scaffold element not showing inside core-pages
  • Java.lang.NoClassDefFoundError:…
  • VueJS: Cannot read property 'name' of undefined"
  • TypeScript metadata reflection references other classes…

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Traverse DOM tree of Polymer element

Next Post:

How can I “refresh” iron-swipeable-container after a change of data in firebase

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Get code errors & solutions at akashmittal.com
© 2022 Fix Code Error