dint-dev / universal_html

Cross-platform 'dart:html'.
https://pub.dev/packages/universal_html
Apache License 2.0
201 stars 60 forks source link

2.2.2 broke DDC builds - skipped compiling warning #74

Open daniel-v opened 1 year ago

daniel-v commented 1 year ago

After upgrading to 2.2.2 from 2.0.9 I started receiving the following errors:

[WARNING] build_web_compilers:entrypoint on web/main_v2.dart: Skipping compiling dumper|web/main_v2.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:

universal_html|lib/src/_sdk_html_additions.dart

https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings

I simply ran webdev serve. 2.0.9 is working fine and is the last version I could get working.

Thank you if you look at it @terrier989 !

Please let me know if you need more info.

terrier989 commented 1 year ago

I tried to reproduce this error with webdev serve, but failed. Do you have the latest version of webdev (you can upgrade with dart pub global activate webdev) and the latest versions of dependencies (dart pub upgrade)?

daniel-v commented 1 year ago

This is my entire package dependency:

dependencies:
  meta:
  html:
#  universal_html: 2.0.9
  universal_html:

dev_dependencies:
  test:
  build_runner:
  build_web_compilers:

I made sure to call dart pub upgrade and verified that packages are up to date. Including webdev.

webdev serve and dart pub run build_runner serve both output the same issue. I'll try to put together minimal repro code.

Dart version:

Dart SDK version: 3.0.0 (stable) (Thu May 4 01:11:00 2023 -0700) on "linux_x64"
daniel-v commented 1 year ago

Well, the repro code with Dart 3 looks like this:

import 'package:universal_html/html.dart';

void main() {
  print('will not compile');
}
daniel-v commented 1 year ago

Addendum: I also tried with Dart 2.19 and still experienced the problem.