Search code examples
dartdart-pub

Running "pub install" for dart-html5-samples leads to weird errors


I encountered some weird errors when running "pub install" for dart-html5-samples. The first one was:

Illegal argument(s): join(): part 0 was null, but part 1 was not.

The second one was:

Running pub install ...
Pub install failed, [1] Resolving dependencies...
Could not find package "unittest 0.0.0-r.13075" at http://pub.dartlang.org.

What's going on, and how do I fix it?


Solution

  • The first error is:

    Illegal argument(s): join(): part 0 was null, but part 1 was not.
    

    That's because pubspec.yaml contained:

    dependencies:
      htmlescape:
        sdk: htmlescape
    

    htmlescape no longer comes with the SDK. Removing the dependency fixed the problem. I simply made a copy of htmlescape.dart in my lib directory. Eventually, I won't need my own copy once the following bug is fixed:

    http://code.google.com/p/dart/issues/detail?id=1657

    The second error is:

    Running pub install ...
    Pub install failed, [1] Resolving dependencies...
    Could not find package "unittest 0.0.0-r.13075" at http://pub.dartlang.org.
    

    dart-html5-samples depends on vector_math which depends on unittest. I think they must have changed how unittest is loaded by pub. Running pub update fixed the problem.