build icon indicating copy to clipboard operation
build copied to clipboard

Unsupported module exception doesn't list which import caused the issue.

Open jonahwilliams opened this issue 6 years ago • 2 comments

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.

jonahwilliams avatar Aug 27 '19 02:08 jonahwilliams

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.

yshahak avatar Sep 12 '19 05:09 yshahak

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.

jakemac53 avatar Sep 12 '19 13:09 jakemac53