Skip to content
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

dartdoc outputs unresolved export uri error #2143

Closed
triallax opened this issue Feb 8, 2020 · 9 comments
Closed

dartdoc outputs unresolved export uri error #2143

triallax opened this issue Feb 8, 2020 · 9 comments
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@triallax
Copy link

triallax commented Feb 8, 2020

Output of flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.15.3 19D76, locale en)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Community Edition (version 2019.3.1)
[✓] VS Code (version 1.41.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

Part of output:

$ flutter pub global run dartdoc
...
error: unresolved export uri: "dart:html_common", from dart-html: (file:///Users/mhmdanas/flutter/bin/cache/pkg/sky_engine/lib/html/html_dart2js.dart:17:9)
...
found 245 warnings and 1 error
Documented 15 public libraries in 165.6 seconds

dartdoc failed: dartdoc encountered 1 errors while processing..
pub finished with exit code 1

Note: The doc directory is still created successfully.

@jcollins-g
Copy link
Contributor

@mhmdanas Is there anything you can share about the package you are documenting?

@jcollins-g jcollins-g added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Feb 10, 2020
@jcollins-g
Copy link
Contributor

Triaging as "P1" pending more information.

@triallax
Copy link
Author

triallax commented Feb 10, 2020

I just created a new flutter project with flutter create and then ran dartdoc. I didn't edit any file.

@kawa89
Copy link

kawa89 commented Feb 28, 2020

Same here with my library https://pub.dev/packages/tweet_ui#-analysis-tab-
I got -10 points in Maintenance :-(

@jcollins-g
Copy link
Contributor

Can reproduce at head flutter as well with latest dartdoc. Looking.

@jcollins-g
Copy link
Contributor

This seems to be due to some missing URI mappings in embedder.yaml. How Flutter works without analysis errors despite the missing mappings is curious.

@jcollins-g
Copy link
Contributor

jcollins-g commented Apr 8, 2020

The root cause is that dart:html_common and its dependency, dart:_metadata, are not part of sky_engine's embedder mappings. Attempting to use the symbol 'promiseToFuture' after importing 'dart:html' will show the bug in a Flutter package:

jcollins-macbookpro2:createfresh jcollins$ ../flutter/bin/flutter analyze
Analyzing createfresh...                                                

   info • Avoid using web-only libraries outside Flutter web plugin packages • lib/main.dart:2:1 • avoid_web_libraries_in_flutter
  error • Undefined name 'promiseToFuture' • lib/main.dart:5:9 • undefined_identifier

2 issues found. (ran in 2.8s)
jcollins-macbookpro2:createfresh jcollins$

This proves that the lack of html_common is a real problem. The analyzer hides errors generated by the SDK which is why we don't see it directly.

The fix will need to proceed in two stages: first, add the .gni data to the SDK repository, and then update the build in flutter/engine to properly copy the SDK files into sky_engine and correct the URI mapping.

@jcollins-g
Copy link
Contributor

first stage of fix: https://dart-review.googlesource.com/c/sdk/+/143020

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Apr 9, 2020
This will enable a fix to an unresolved export that causes Dartdoc
to complain about all Flutter packages.

Bug: dart-lang/dartdoc#2143
Change-Id: I634e21066420b100295989cf9bdcd35af91a617b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143020
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
@jcollins-g
Copy link
Contributor

The fix for #1949 eliminates this bug as well and will go out in the next version. There is still the general issue of sky_engine reexporting dart libraries with missing mappings, but I'll leave that question to flutter./flutter#54793 as it's no longer creating an acute problem for dartdoc.

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Apr 14, 2020
This reverts commit 75e1f2a.

Reason for revert: Fix for dartdoc #1949 makes this no longer strictly necessary.  While this leaves the underlying imports unfixed, I will instead file an issue against the engine.

Original change's description:
> Add html_common to .gni files.
>
> This will enable a fix to an unresolved export that causes Dartdoc
> to complain about all Flutter packages.
>
> Bug: dart-lang/dartdoc#2143
> Change-Id: I634e21066420b100295989cf9bdcd35af91a617b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143020
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Commit-Queue: Janice Collins <jcollins@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dart-lang/dartdoc#2143
Change-Id: Ibe25eee8031b348d9260245daca84d9742fbb894
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143402
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
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
Projects
None yet
Development

No branches or pull requests

3 participants