New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Not found: 'dart:html' #53287
Comments
to give more background on the timeline of my rather messy flutter project:
|
This error is almost certainly caused by depending on web only code in a mobile flutter application. If you think this is a bug with tooling then we'll need an example project that reproduces the issue |
yeah i just tested with a naked flutter app: $flutter create test_app and it runs fine on ios. @jonahwilliams: I just tried to rebuild my android app and its giving me the same error: "Error: Not found: 'dart:html'" So the issue was definitely from me switching to beta and then building for web. The interesting thing is I didn't add any web-only code or web-plugins. My entire project built cleanly as posted above, in android, before doing $flutter build web. Is there a way I can easily undo whatevever this command did: $flutter build web? I'm guessing that's causing the problem. In an unrelated note, from my novice vantage point, it's not clear what "web only" code means in the context of flutter and dart. The reason I'm using flutter is so I don't have to think about web vs android vs ios in the first place. |
|
YOU WERE RIGHT! the cluprit is the cloud_firestore_web package. I commented out: import 'package:cloud_firestore_web/cloud_firestore_web.dart'; and the ios build works, but with the following non-critical errors: Invalid depfile: /Users/ryan/flutter_apps/flutter-firestore-todo/.dart_tool/flutter_build/eeccd0fb720df2a1c444aac1f4f2c03d/kernel_snapshot.d |
To confirm, were you importing |
I added it to my main.dart file, it was not generated. After reading the docs, I realized the updated cloud_firestore package can handle web without the _web helper package being explicitly added. |
Okay cool, thank you! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
building for android in android studio works, but when I try to build for ios on command line I get errors.
Pubspec: version: 1.0.0+1 environment: sdk: ">=2.1.0 <3.0.0" dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.2 cloud_firestore: ^0.13.2+1 url_launcher: ^5.4.2 flutter_linkify: ^3.1.0 url_launcher_web: ^0.1.0 clipboard_manager: ^0.0.1 cloud_firestore_web: ^0.1.1+2 intl: ^0.16.1 dev_dependencies: flutter_test: sdk: flutter
see all the errors
probably same issue as #53005 and possibly #52763
The text was updated successfully, but these errors were encountered: