1

Opportunity:

Hello, I have a situation that I simply can't figure-out. I am getting these errors from Dart when I run a quite simple example:

 [13288:9212:0320/161303:ERROR:navigation_entry_screenshot_manager.cc(147)] Invalid entry with unique id: 3

 [14080:11508:0320/155717:ERROR:chrome_views_delegate.cc(185)] NOT IMPLEMENTED
 [14080:11508:0320/155717:ERROR:desktop_root_window_host_win.cc(753)] NOT IMPLEMENTED

 [14080:11508:0320/155719:ERROR:desktop_root_window_host_win.cc(753)] NOT IMPLEMENTED

 [14080:11508:0320/155747:ERROR:extension_icon_image.cc(201)] Start loading extension icon for Chromium. scale = 1

The messages don't really connect to the Use-Case I'm implementing. My attempts to use debug and other tools have come to not much indeed. I have 'reduced' the problem to a simple example based on the DartPolymer example:

This tutorial defines a DartPolymer component called <tut-stopwatch>. In my example I have copied that element as two clones: <x-fred> and <z-fred>. Everything is identical in a diff command, except the names and tags.

The layout of the main index.html page is as follows:

<body>
    <x-fred> </x-fred>
    <hr/>    
    <h1>Stopwatch</h1>
    <tut-stopwatch> </tut-stopwatch>
    <hr/>    
    <z-fred> </z-fred>
</body>

Investigation so far:

I put a break-point on the DOM register call and the stopwatch creator (constructor):

 class TuteStopwatch extends PolymerElement {
   @observable String counter='00:00';

   TuteStopwatch.created() : super.created();

     :     
}

The "unique id message" as I call it comes up:

[13288:9212:0320/161303:ERROR:navigation_entry_screenshot_manager.cc(147)] Invalid entry with unique id: 3

During debugging. There's no clear connection to the code executing and I think that this is an async message, unrelated to the registration of the <tut-stopwatch> component.

The other two examples (different in name and a label only): <x-fred> and <z-fred> work fine. It is just the <tut-stopwatch> element that poses a problem.

This is difficult for two reasons:

  1. I have a stand-alone <tut-stopwatch> example working fine.
  2. Despite text and lexical code-compare of three bits of "congruent" code, one is flawed in a specific context. It speaks to a lack of robustness some place.

Obviously I need a bit of direction on where to look for the problem. It reminds me of those games: "One of these things is not like the other . . . "

Thanks in advance.


Code

<tut-stopwatch>

Based on: Define a Custom Element example:

 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.

 import 'dart:html';
 import 'dart:async';
 import 'package:polymer/polymer.dart';

 @CustomTag('tute-stopwatch')
 class TuteStopwatch extends PolymerElement {
   @observable String counter='00:00';

   TuteStopwatch.created() : super.created();

   Stopwatch mywatch = new Stopwatch();
   Timer mytimer;
   :


 }

<x-fred>

@CustomTag('x-fred')
//@CustomTag('tute-stopwatch')
class XFred extends PolymerElement {
  @observable String counter='00:00';

  XFred.created() : super.created();

  Stopwatch mywatch = new Stopwatch();
  Timer mytimer;


   Stopwatch mywatch = new Stopwatch();
   Timer mytimer;
   :


 }
  • Note: each element is in a different sub-folder and there is no name space collision between on the TuteStopwatch{...} class with <x-fred> and <z-fred>

tut_stopwatch.html

This file is in its own folder with tute_stopwatch.dart:

  • elements/fred/tute_stopwatch.html

    <template>
      <style>
        :host {
            background-color: yellow;
            text-align: center;
            display: inline-block;
            border: solid 1px;
            padding: 10px 10px 10px 10px;
        }
      </style>
      <div>
        <div> stopwatch: 
          {{counter}}
        </div>
        <div>
          <button on-click="{{start}}" id="startButton">Start</button>
          <button on-click="{{stop}}"  id="stopButton">Stop</button>
          <button on-click="{{reset}}" id="resetButton">Reset</button>
        </div>
      </div>
    </template>
    
    <script type="application/dart" src="tute_stopwatch.dart"> </script>
    

fred.html (<x-fred>)

This file is in its own folder with Fred.dart:

  • elements/fred/fred.html

    <template>
      <style>
        :host {
            background-color: blue;
            text-align: center;
            display: inline-block;
            border: solid 1px;
            padding: 10px 10px 10px 10px;
        }
      </style>
      <div>
        <div> fred: 
          {{counter}}
        </div>
        <div>
          <button on-click="{{start}}" id="startButton">Start</button>
          <button on-click="{{stop}}"  id="stopButton">Stop</button>
          <button on-click="{{reset}}" id="resetButton">Reset</button>
        </div>
      </div>
    </template>
    
    <script type="application/dart" src="fred.dart">  </script>
    

will
  • 4,799
  • 8
  • 54
  • 90
  • Have you tried if the error goes away when you change the class name of x-fred? Might be a bug. – Günter Zöchbauer Mar 20 '14 at 06:16
  • Thanks [Günter](http://stackoverflow.com/users/217408/gunter-zochbauer), I changed each class' name to: XStopwatch and ZStopwatch -- Same problem with the original TuteStopwatch class (or tut_Stopwatch.html) – will Mar 20 '14 at 07:01
  • Can you post the HTML code of `` and ``? Have you checked that the HTML of each tag points to the correct `*.dart` file? – Günter Zöchbauer Mar 20 '14 at 07:09
  • Added the HTML and modified the fred class: XFred. I'm pretty convinced it is a bug since the stopwatch itself works fine in another project. – will Mar 20 '14 at 09:34
  • One thing. I have also purged the shadow Packages symlinks and the Packages cache to ensure everything is built to the latest release. – will Mar 20 '14 at 09:40
  • What versions are you using (Dart, Polymer). Have you tried `pub upgrade`? If yes this might be a bug but I wonder because it's such a simple application and Polymer works quite good for me recently also in more complex scenarios. – Günter Zöchbauer Mar 20 '14 at 09:44
  • I did a complete delete for the Pacakges Cache. The current version are ... Dart = [Dart VM version: 1.2.0 (Tue Feb 25 06:18:15 2014) on "windows_ia32"], Polymer-Dart = 0.9.5 (there's a v10 but is is buggy). This is Windows 7/64-bit. Not sure if that 32-bit option is a killer. – will Mar 20 '14 at 10:53
  • What problem did you have with 0.10.0? This might also only be a problem with Dart 1.2 but not with 1.3.0-dev.x. – Günter Zöchbauer Mar 20 '14 at 10:57
  • The problem persisted with the beta; [Dart VM version: 1.3.0-dev.4.1 (Sun Mar 16 12:31:12 2014) on "windows_ia32"] – will Mar 21 '14 at 07:44
  • I'm out of ideas. Can you make the project available as a github project. When I find time I'll take a look. – Günter Zöchbauer Mar 21 '14 at 09:39

1 Answers1

0

github

I have put the failing case on GitHub here: - https://github.com/aplatypus/dart-experiments

This version fails to show the tute-stopwatch element. Yet clones with a different name work OK. Same code, just different names.

work-around

I can report that I have a work-around. I'm more or less convinced that its a Dart or Dart Editor bug though.

The fix was to manually rename: <tute-stopwatch> to: <x-stopwatch>

The x-stopwatch version of the (same) code then worked a-OK. Then I renamed the custom element back again to:

  • <tute-stopwatch>

And now the: <tute-stopwatch> is working.

I don't think its a satisfying resolution because I pretty much purged the project folder and Packages cache a couple of times. There be something hanging about me thinks.

Also I'm still seeing odd errors:

F:\.bin\dev\dart\dev\chromium\Chrome.exe --remote-debugging-port=59082 --user-data-dir=C:\Users\william\.dartium --enable-experimental-web-platform-features --enable-html-imports --no-first-run --no-default-browser-check --no-process-singleton-dialog chrome://version/
[18040:16896:0322/210119:ERROR:chrome_views_delegate.cc(185)] NOT IMPLEMENTED
[18040:16896:0322/210119:ERROR:desktop_root_window_host_win.cc(753)] NOT IMPLEMENTED

[18040:16896:0322/210121:ERROR:desktop_root_window_host_win.cc(753)] NOT IMPLEMENTED

When I completely remove the tute-stopwatch element the messages go away, but I still see this:

[18040:16896:0322/210647:ERROR:navigation_entry_screenshot_manager.cc(147)] Invalid entry with unique id: 6

The number for 'unique id' changes from run to run of course.

I figured I'd post the outcome. If you have a similar situation try a different name for the element in question. That may help someone facing similar weirdness.

will
  • 4,799
  • 8
  • 54
  • 90
  • I found a question with a similar error: http://stackoverflow.com/questions/21423486 For me this indicates that you are doing something in an unusual way. Can you publish your entire project on github so I can try to reproduce? – Günter Zöchbauer Mar 22 '14 at 10:17
  • I don't get the errors you mentioned but `z-fred` is not show here too. I'll investigate further later and keep you updated. – Günter Zöchbauer Mar 22 '14 at 11:49
  • You have mixed `tut-stopwatch` and `tute-stopwatch` (`index.html`, `tute_stopwatch.html` `name='tut-stopwatch' and `tute_stopwatch.dart` `@CustomTag('tute-stopwatch')`) must all use the same tag name. Correct it and it works fine. – Günter Zöchbauer Mar 23 '14 at 14:35