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
Namely, I cannot build any of my projects that depend on conditional imports to differentiate between VM and web platforms.
A good example would be package:universal_html that is publicly available.
Dart SDK version: 2.13.4 (stable) (Wed Jun 23 13:08:41 2021 +0200) on "linux_x64"
Affected builder package: build_modules v4.0.2 (v4.0.1 works fine)
# dart run build_runner serve web:8080
[SEVERE] build_modules:module_library on package:universal_html/js.dart: Invalid argument(s): Unsupported conditional import of `dart:js` found in universal_html|lib/js.dart:
export'dart:js';
This environment does not support direct conditional imports of `dart:` libraries. Instead you must create a separate library which unconditionally imports (or exports) the `dart:` library that you want to use, and conditionally import (or export) that library.
With dart2js
# dart run build_runner serve -r --define 'build_web_compilers|entrypoint=compiler=dart2js' --define 'build_web_compilers|entrypoint=dart2js_args=["-O1"]' web:8080
[SEVERE] build_modules:module_library on package:universal_html/js.dart (cached):
Invalid argument(s): Unsupported conditional import of `dart:js` found in universal_html|lib/js.dart:
export'dart:js';
The text was updated successfully, but these errors were encountered:
The example you have shown was never intended to work. I think there was a bug where we allowed conditional imports/exports of dart: libraries if the default import was a dart: library.
I would forward fix the package to export a library that exports dart:js.
@jakemac53 's changes in #3170 as a response to @mraleph 's issue of dart-lang/sdk#46918 has had some side effects.
Namely, I cannot build any of my projects that depend on conditional imports to differentiate between VM and web platforms.
A good example would be package:universal_html that is publicly available.
build_modules v4.0.2
(v4.0.1 works fine)Repro code
Observed errors
With DDC:
With dart2js
The text was updated successfully, but these errors were encountered: