dint-dev / universal_html

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

Build error: "Unable to find modules for some sources" #10

Closed lfwells closed 4 years ago

lfwells commented 4 years ago

Hi all, I am getting the following error when importing this package for flutter web. Am I missing something or am I completely off-base?

bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).

Please check the following imports:

import 'package:universal_html/html.dart';

I have the package under dependencies in pubspec.yaml: universal_html: ^1.1.10 (it is not under dev_dependencies

I am on: Flutter 1.13.8-pre.58 • channel master • https://github.com/flutter/flutter.git Framework • revision fabf4e3d0d (8 hours ago) • 2020-01-08 15:28:02 -0800 Engine • revision 46adf73d51 Tools • Dart 2.8.0 (build 2.8.0-dev.0.0 c0ca187f26)

terrier989 commented 4 years ago

Does flutter pub cache repair solve the issue?

lfwells commented 4 years ago

I returned to this issue after doing some other stuff, and during the process of that I did a flutter clean (just that, not what you wrote). When I went to try your suggestion, it was already building no problems. I think it may have just been my packages cache playing up (hence your suggestion). Rookie flutter error, not an issue with this plugin.

Also, confirming this plugin saved my bacon not being able to use dart:html on non-web platforms. I wanted my flutter web app to have a pointer mouse cursor for buttons (obviously not needed on Android/ios), but to use the same codebase for Android iOS. Mission completed!