You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When transpiling for Dart Web I got this warning, which is fatal because it breaks the transpile:
[WARNING] build_web_compilers:entrypoint on web/main.dart: Skipping compiling my_project|web/main.dart with dart2js because some of its
transitive libraries have sdk dependencies that are not supported on this platform:
logger|lib/src/outputs/file_output_stub.dart
https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings
Hi, what a bummer...
Sorry, this took me some time to research and understand your use-case and investigate possible solutions.
It seems that there are only two viable options for Dart Web projects:
Modify the build.yaml to change the web_compiler strategy to fine, as described here (I have successfully tested this myself, however I am not sure whether this configuration has any other side effects, so use with care!)
Remove the stub from the exports, or in other words, make a web-only export library (as in your PR).
I also tried modifying the stub to circumvent the pointless warning, but without using dynamic as type it seems to be impossible to satisfy the web compiler (using dynamic would also render the stub effectively impractical).
Interesting sidenote: The reason why this problem "only" exists in Dart and not in Flutter is because they made an (originally temporary) exception for Flutter Web. Source: dart-lang/build#3614 (comment)
When transpiling for Dart Web I got this warning, which is fatal because it breaks the transpile:
I tried to bypass it by replacing this:
into this:
which leads to these static warnings (non-fatal), but the fatal warning still not solved:
Firstly I want to solve the fatal warning: Is there a way to import in a
web safe
way?Secondly, would be great that the first solution also removes the non fatal warnings.
Thanks
The text was updated successfully, but these errors were encountered: