build
build copied to clipboard
Unsupported module exception doesn't list which import caused the issue.
If I configure flutter for web to not support dart:io and then attempt to compile with ddc, I get an error as expected.
[ +679 ms] Skipping compiling hello_world|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:
hello_world|lib/main.dart
https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings
However this error doesn't list that dart:io was the cause of the error. I think this information should already be known internally, and sharing it should help users figure out what went wrong.
I am getting the same:
Skipping compiling clients|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:
But just when I'm including this code in my main.dart:
import 'dart:io' show Platform;
void main() async {
var isMobile = Platform.isAndroid || Platform.isAndroid;
print(isMobile);
runApp(MyApp());
}
I have no clue what I can do as a bypass.
import 'dart:io' show Platform; This is the part that is the problem. You can follow https://github.com/flutter/flutter/issues/39998 for updates.