-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unclear error message when using Dart web core libraries in Dart native #47260
Comments
A better error message could be
or, for the other direction:
It requires the front-end (I guess) to be aware of all |
@johnniwinther wdyt? |
We should make this change but it might take while due to technical difficulties. |
My team is getting same issue today, when trying to build for iOS & Android. It got fixed when we removed this line from js.dart which is there in pub-cache
@johnniwinther any help please |
@krishnatejakanchi you are importing some package that is only going to work on the web (i.e. some of your code is importing |
I tried running
@mraleph Can you please suggest a way, how can i find that incorrect dependency. |
@krishnatejakanchi unfortunately there is no easy way to find this dependency AFAIK. The simplest approach you could try is just rename |
@johnniwinther I would like to suggest a bunch of improvements for the CFE error messaging (if feasible):
As more and more people starting to use Dart in multiplatform environment it would be great to have better error messaging in place. |
WIP: https://dart-review.googlesource.com/c/sdk/+/261821 that shows the import path (in case of missing dart: libraries for now only) |
This special-cases the error for importing/exporting dart: libraries that are not available on the current platform and includes a detail description of how the unavailable library was imported in the context of the error message. Currently there is no special casing of the message depending on the unavailable library and the current platform, as this is meant as a catch-all message. In a follow-up I'll add special casing of the message for some of these cases. In response to #47260 Change-Id: Ia296f9ca1b03bf664e12241a139970ef31c8a2d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261821 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Jens Johansen <jensj@google.com>
If one imports a Dart web
dart:
library and tried to run it in a Dart native runtime, an error like this is shown during compilation:Could we say something more specific like this?
Here's the list of core libraries I think this makes sense for (the last table on the page):
https://dart.dev/guides/libraries#web-platform-libraries
The text was updated successfully, but these errors were encountered: