-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
app named web_ui can't use web_ui package #12300
Comments
Set owner to @munificent. |
With: https://codereview.chromium.org/22825024/ You'll get an error if you try to add a dependency on a package with the same name as your own package. That should help you avoid this confusing situation. You can still end up in a confusing (but intentionally supported state) if you have an indirect dependency on yourself, but we need that use case to work. |
Added Fixed label. |
This issue has been moved to dart-lang/pub#611. |
OK, this seems obvious in hindsight, but I should've seen a better error/warning.
In Dart Editor I created a little app to test web_ui, named the app web_ui (duh!), and then (not editing the boilerplate code a bit) got this error message:
Unable to open file: /Users/kathyw/dart/web_ui/packages/web_ui/component_build.dart'file:///Users/kathyw/dart/web_ui/build.dart': Error: line 2 pos 1: library handler failed
import 'package:web_ui/component_build.dart';
^
Looking in packages, I saw browser, js, and meta, but not web_ui. I tried
pub install
on the command line, and it happily executed without a single error message or warning.Apparently, pub install can't/doesn't get web_ui if your app is named web_ui. I assume this is true for any package that has the same name as the app.
Pub install (and/or the editor) should give you a warning about this. If this behavior is technically correct, the message could just be something like: Didn't download web_ui package because this app is named web_ui.
The text was updated successfully, but these errors were encountered: