Skip to content

Dart doc failed after publishing but works fine locally #7149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
buijs-dev opened this issue Oct 20, 2023 · 2 comments · Fixed by dart-lang/pana#1272
Closed

Dart doc failed after publishing but works fine locally #7149

buijs-dev opened this issue Oct 20, 2023 · 2 comments · Fixed by dart-lang/pana#1272

Comments

@buijs-dev
Copy link

buijs-dev commented Oct 20, 2023

Problem

On pub my package gets 0/10 points because dart doc fails.
Running dart doc locally works (Flutter 3.10.6):

@macbook-pro klutter-dart-ui % dart doc
Documenting klutter_ui... Initialized dartdoc with 685 libraries
Generating docs for library klutter_ui from package:klutter_ui/klutter_ui.dart...
no issues found
Documented 1 public library in 33.5 seconds

name: klutter_ui
description: Flutter widgets to be used in conjunction with the klutter plugin.
version: 1.0.1
homepage: https://buijs.dev
repository: https://github.com/buijs-dev/klutter-dart-ui

environment:
  sdk: ">=2.17.6 <4.0.0"

dependencies:
  flutter:
    sdk: flutter

dev_dependencies:
  coverage: ^1.6.4
  dartdoc: ^6.3.0
  test: ^1.24.7
  pana: ^0.21.39

--trace output

Running analysis for "klutter_ui" version "1.0.1"

STARTED: 2023-10-20T17:09:13.586798Z

Starting dartdoc

INFO: 2023-10-20 17:09:30.253398: Running /home/worker/dart/stable/bin/dart --version...
INFO: 2023-10-20 17:09:30.368589: Running /home/worker/flutter/stable/bin/flutter --no-version-check --version --machine...
WARNING: 2023-10-20 17:09:31.096535: Unable to detect Flutter version.
ERROR: Exception: Unable to parse output as JSON:

OUT:
{
  "frameworkVersion": "3.13.6",
  "channel": "[user-branch]",
  "repositoryUrl": "unknown source",
  "frameworkRevision": "ead455963c12b453cdb2358cad34969c76daf180",
  "frameworkCommitDate": "2023-09-26 18:28:17 -0700",
  "engineRevision": "a794cf2681c6c9fe7b260e0e84de96298dc9c18b",
  "dartSdkVersion": "3.1.3",
  "devToolsVersion": "2.25.0",
  "flutterVersion": "3.13.6",
[29 more lines]

, null
INFO: 2023-10-20 17:09:31.139907: Downloading package klutter_ui 1.0.1 from https://pub.dartlang.org/packages/klutter_ui/versions/1.0.1.tar.gz
INFO: 2023-10-20 17:09:31.391354: Running pub upgrade
INFO: 2023-10-20 17:09:31.447317: Running /home/worker/flutter/stable/bin/flutter --no-version-check packages pub upgrade --no-example --verbose...
Unhandled exception:
type 'Null' is not a subtype of type 'YamlMap' in type cast
#0 yamlToJson (package:pana/src/utils.dart:185:39)
dart-lang/pub#1 _dartdoc (package:pub_worker/src/bin/dartdoc_wrapper.dart:140:23)

dart-lang/pub#2 main (package:pub_worker/src/bin/dartdoc_wrapper.dart:56:5)

Execution of dartdoc exited 255

STOPPED: 2023-10-20T17:09:40.411301Z

Starting pana

2023-10-20 17:09:54.731194 INFO: Running /home/worker/dart/stable/bin/dart --version...
2023-10-20 17:09:54.774316 INFO: Running /home/worker/flutter/stable/bin/flutter --no-version-check --version --machine...
2023-10-20 17:09:55.389446 INFO: Downloading package klutter_ui 1.0.1 from https://pub.dartlang.org/packages/klutter_ui/versions/1.0.1.tar.gz
2023-10-20 17:09:55.756660 INFO: Running /home/worker/flutter/stable/bin/flutter --no-version-check pub pub get --no-example...
2023-10-20 17:09:57.090701 INFO: Running /home/worker/flutter/stable/bin/flutter --no-version-check pub pub get --no-example...
2023-10-20 17:09:58.135475 INFO: Running /home/worker/flutter/stable/bin/flutter --no-version-check pub pub outdated --json --up-to-date --no-dev-dependencies --no-dependency-overrides...
2023-10-20 17:09:59.520097 INFO: Analyzing package...
2023-10-20 17:09:59.550283 INFO: Running /home/worker/flutter/stable/bin/cache/dart-sdk/bin/dart analyze --format machine lib...
2023-10-20 17:10:13.026050 INFO: Running git init...
2023-10-20 17:10:13.198140 INFO: Running git remote add origin https://github.com/buijs-dev/klutter-dart-ui...
2023-10-20 17:10:13.250596 INFO: Running git remote show origin...
2023-10-20 17:10:15.150477 INFO: Running git fetch --depth 1 --no-recurse-submodules origin main...
2023-10-20 17:10:15.889130 INFO: Running git ls-tree -r --name-only --full-tree origin/main...
2023-10-20 17:10:15.917670 INFO: Running git show origin/main:pubspec.yaml...
2023-10-20 17:10:16.510151 INFO: Running /home/worker/dart/stable/bin/dart format --output=none --set-exit-if-changed /tmp/pana_SRKVUN/lib...
2023-10-20 17:10:17.749240 INFO: Writing summary.json

Execution of pana exited 0

STOPPED: 2023-10-20T17:10:17.853203Z

@sigurdm sigurdm transferred this issue from dart-lang/pub Oct 30, 2023
@sigurdm
Copy link
Contributor

sigurdm commented Oct 30, 2023

From the logs:

## Running analysis for "klutter_ui" version "1.0.1"
STARTED: 2023-10-26T14:59:18.694045Z

### Starting dartdoc
INFO: 2023-10-26 14:59:36.309824: Running `/home/worker/dart/stable/bin/dart --version`...
INFO: 2023-10-26 14:59:36.365039: Running `/home/worker/flutter/stable/bin/flutter --no-version-check --version --machine`...
INFO: 2023-10-26 14:59:36.599670: Downloading package klutter_ui 1.0.1 from https://pub.dartlang.org/packages/klutter_ui/versions/1.0.1.tar.gz
INFO: 2023-10-26 14:59:36.877108: Running pub upgrade
INFO: 2023-10-26 14:59:36.936733: Running `/home/worker/flutter/stable/bin/flutter --no-version-check packages pub upgrade --no-example --verbose`...
Unhandled exception:
type 'Null' is not a subtype of type 'YamlMap' in type cast
#0      yamlToJson (package:pana/src/utils.dart:185:39)
#1      _dartdoc (package:pub_worker/src/bin/dartdoc_wrapper.dart:140:23)
<asynchronous suspension>
#2      main (package:pub_worker/src/bin/dartdoc_wrapper.dart:56:5)
<asynchronous suspension>
### Execution of dartdoc exited 255
STOPPED: 2023-10-26T14:59:38.534677Z
### Starting pana
2023-10-26 14:59:53.575228 INFO: Running `/home/worker/dart/stable/bin/dart --version`...
2023-10-26 14:59:53.618929 INFO: Running `/home/worker/flutter/stable/bin/flutter --no-version-check --version --machine`...
2023-10-26 14:59:53.874053 INFO: Downloading package klutter_ui 1.0.1 from https://pub.dartlang.org/packages/klutter_ui/versions/1.0.1.tar.gz
2023-10-26 14:59:54.187633 INFO: Running `/home/worker/flutter/stable/bin/flutter --no-version-check pub pub get --no-example`...
2023-10-26 14:59:55.580542 INFO: Running `/home/worker/flutter/stable/bin/flutter --no-version-check pub pub get --no-example`...
2023-10-26 14:59:56.651397 INFO: Running `/home/worker/flutter/stable/bin/flutter --no-version-check pub pub outdated --json --up-to-date --no-dev-dependencies --no-dependency-overrides`...
2023-10-26 14:59:58.073508 INFO: Analyzing package...
2023-10-26 14:59:58.103675 INFO: Running `/home/worker/flutter/stable/bin/cache/dart-sdk/bin/dart analyze --format machine lib`...
2023-10-26 15:00:03.595284 INFO: Running `/home/worker/dart/stable/bin/dart format --output=none --set-exit-if-changed /tmp/pana_YRXVUE/lib`...
2023-10-26 15:00:04.217709 INFO: Writing summary.json
### Execution of pana exited 0
STOPPED: 2023-10-26T15:00:04.323707Z

@isoos do you see what is going on?

@isoos
Copy link
Collaborator

isoos commented Oct 30, 2023

Apparently we have failed to handle the customization of the empty dartdoc_options.yaml:
https://github.com/buijs-dev/klutter-dart-ui/blob/main/dartdoc_options.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants