1

I'm using the Bootjack Datepicker and after upgrading Dart to 1.12.1, I'm all of a sudden seeing only half a calendar with no days and with this exception:

Exception: No static getter 'trusted' declared in class 'NodeTreeSanitizer'. NoSuchMethodError: method not found: 'trusted' Receiver: Type: class 'NodeTreeSanitizer'

This is the only line of code needed to wire the calendar:

Calendar.use();

If you need to manually wire the calendar, you can manually call:

Calendar.wire(querySelector("div.calendar"));

Both of them are giving me the exception in calendar.dart

The code that seems to be breaking is:

void _dayView() {
    TableElement calBody = element.querySelector('.cnt');
    Element dow = calBody.tBodies[0].createFragment(_DOW_TEMPLATE).children[0];
    List<Element> children = dow.children;

    List<String> swkDays = _dfmt.dateSymbols.SHORTWEEKDAYS;
    int ofs = (_firstDayOfWeek + 1) % 7;
    //render week days
    for (int i = swkDays.length; --i >= 0;) {
      children[i].text = swkDays[(i + ofs) % 7];
    }

    var buffer = new StringBuffer();
    for (int i = 6; --i >= 0;) {
      buffer.write(_DAYROW_TEMPLATE);
    }

    calBody.tBodies[0]
    ..append(dow)
    ..appendHtml(buffer.toString(), treeSanitizer: NodeTreeSanitizer.trusted);   <<<<<<<< ERROR
  }

Looking at appendHtml, I can see treeSanitizer is an optional param, so that syntax looks fine. In the abstract class NodeTreeSanitizer, I can see: static const trusted = const _TrustedHtmlTreeSanitizer();, so that seems to be fine as well.

Any idea what could be causing this error?

I've logged a bug here in the meantime: https://github.com/rikulo/bootjack-datepicker/issues/2

Jan Vladimir Mostert
  • 12,380
  • 15
  • 80
  • 137
  • 1
    `NodeTreeSaniztizer.trusted` was added only recently. Where do you get this error? In Dartium or Chrome or both? What Dart version are you using? – Günter Zöchbauer Sep 29 '15 at 06:17
  • I'm seeing this in Dartium, in compiled JS on production, the calendar seems to work. `pub --version` outputs 1.12.1. Are you suggesting that my Dartium might be outdated? – Jan Vladimir Mostert Sep 29 '15 at 06:20
  • 1
    Yes, it looks like your Dartium is outdated. You could check the Dart version in `about://version` in Dartium. – Günter Zöchbauer Sep 29 '15 at 06:26
  • 1
    Dart version says 1.11.1, so that's probably why it's breaking since I'm on 1.12.1. I've already done a brew update and brew upgrade and there seems to be no updates to Dartium. Will try and re-install it. – Jan Vladimir Mostert Sep 29 '15 at 06:29

1 Answers1

2

Looks like your Dartium version is outdated.
Please compare the output of dart --version (command line) and the Dart version on the about://version page in Dartium.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • How do I upgrade Dartium? Looking in `/usr/local/Cellar/dartium`, I can see several dozen versions of Dartium stopping at 1.11.1. `brew update & brew upgrade dartium` returns `Error: No available formula for dart-lang/dart/dartium`. Has dartium been removed from Homebrew? – Jan Vladimir Mostert Sep 29 '15 at 06:42
  • 1
    I'm on Linux, don't know about `brew`. Have you tried uninstalling and install with `brew install dart --with-dartium`, `brew linkapps` (https://github.com/dart-lang/homebrew-dart). Update is done with `brew update`,`brew upgrade dart`. If it doesn't work please file an issue at https://github.com/dart-lang/homebrew-dart/issues – Günter Zöchbauer Sep 29 '15 at 06:47
  • 1
    Yes, just removed dart completely from my system and reinstalling with the special flags. I can see Dartium 1.12.1 downloading now. In the past, it used to be two separate packages, it seems they've been merged into one package now and the --with-dartium option wasn't available back then, so I never had that flag ticked. Thanks for the help! – Jan Vladimir Mostert Sep 29 '15 at 06:55