Skip to content

dartdoc crashes on invalid prefix imports #1896

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
isoos opened this issue Jan 10, 2019 · 1 comment · Fixed by #1899
Closed

dartdoc crashes on invalid prefix imports #1896

isoos opened this issue Jan 10, 2019 · 1 comment · Fixed by #1899
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@isoos
Copy link
Contributor

isoos commented Jan 10, 2019

NPE on vint 0.7.3 (dartdoc 0.27.0)

Generating docs for vint 0.7.3:

Unhandled exception:
NoSuchMethodError: The getter 'kind' was called on null.
Receiver: null
Tried calling: kind
#0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
#1      new ModelElement.from (package:dartdoc/src/model.dart:2913:11)
#2      Library.prefixToLibrary (package:dartdoc/src/model.dart:2242:19)
#3      _MarkdownCommentReference._findReferenceFromPrefixes (package:dartdoc/src/markdown_processor.dart:570:51)
#4      _MarkdownCommentReference.computeReferredElement (package:dartdoc/src/markdown_processor.dart:383:17)
#5      _getMatchingLinkElement (package:dartdoc/src/markdown_processor.dart:202:10)
#6      _linkDocReference (package:dartdoc/src/markdown_processor.dart:743:12)
#7      Documentation._renderMarkdownToHtml._linkResolver (package:dartdoc/src/markdown_processor.dart:988:26)
#8      LinkSyntax._resolveReferenceLink (package:markdown/src/inline_parser.dart:699:14)
#9      LinkSyntax._tryAddReferenceLink (package:markdown/src/inline_parser.dart:721:9)
@jcollins-g jcollins-g added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jan 11, 2019
@jcollins-g
Copy link
Contributor

This package is extremely broken on Dart 2.0+ The specific problem is that there is a prefix import 'dart:json' that doesn't resolve, and the new prefix support assumed that the dart code to document was valid.

@jcollins-g jcollins-g changed the title NPE on vint 0.7.3 (dartdoc 0.27.0) dartdoc crashes on invalid prefix imports Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants