Skip to content

dartdoc throws fatal exception when package refers to another (non-pub) package #2378

@srp7474

Description

@srp7474

The context is a flutter package.

Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel beta, 1.22.0, on Microsoft Windows [Version 6.1.7601], locale en-CA)
[?] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[?] Chrome - develop for the web
[?] Android Studio (version 4.0)
[?] Connected device (2 available)

dartdoc version: 0.32.4

When the package does not make reference to another package the dartdoc tool runs like a champ.

If the package makes reference to another package it gets an error (after deliberating for a minute or 2) as shown below.

I suspect it is a matter of setting up the dartdoc_options.yaml file correctly but I could find no doc that seemed to help. I tried using the include / exclude options but it is not entirely clear how the name matches the package name or the library pointers.

I tried flutter pub get but it made no difference

dartdoc failed: NoSuchMethodError: The getter 'path' was called on null.
Receiver: null
Tried calling: path
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      _FilePackageMeta.hostedAt (package:dartdoc/src/package_meta.dart:311:53)
#2      createDartdocOptions.<anonymous closure> (package:dartdoc/src/dartdoc_options.dart:1642:38)
#3      DartdocSyntheticOption._valueAtFromSynthetic (package:dartdoc/src/dartdoc_options.dart:836:54)
#4      DartdocOptionFileSynth.valueAt (package:dartdoc/src/dartdoc_options.dart:735:12)
#5      DartdocOptionContext.linkToUrl (package:dartdoc/src/dartdoc_options.dart:1469:54)
#6      Package.documentedWhere (package:dartdoc/src/model/package.dart:193:43)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failurescustomer-flutterIssues originating from important to Fluttertype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions