Open ziobudda opened 2 years ago
pakcage:yaml_edit
does not support yaml-references, but we could catch the exception and give a proper error message here.
I got the same error when I add "flutter pub add freezed_annotation". Thanks for the message but it is needed to be fixed. 🙏
@BansookNam can you make a reproduction?
We should give a nicer error message. But I don't think we'll ever have support for the combination of dart pub add
and yaml references.
@sigurdm I made a flutter project for reproduction. https://github.com/BansookNam/dart_reproduction
You can reproduce this by running 'flutter pub add freezed_annotation'.
This is my flutter doctor [✓] Flutter (Channel stable, 3.10.1, on macOS 13.1 22C65 darwin-arm64, locale en-KR) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [✓] Xcode - develop for iOS and macOS (Xcode 14.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] IntelliJ IDEA Community Edition (version 2022.2.4) [✓] VS Code (version 1.78.2) [✓] Connected device (2 available) [✓] Network resources
Thanks for the reproduction
Yeah :( - don't expect yaml references to work with dart add
anytime soon. Adding that functionality to yaml_edit would be highly non-trivial (it is not clear if an update involving a reference should update the reference or the referencing site).
Consider not using yaml references, or manually editing pubspec.yaml
I believe pub.dev doesn't allow publishing packages with yaml references (as they cannot trivially be represented as json for the version listing api)
@jonasfj should we just make it an error to have yaml references in pubspec.yaml? That would probably be too breaking...
Should we try making_yaml edit work such that if you are updating parts of the file without references things just work?
I'm using ISAR for my project and now I want to add an infinite scroll pagination, but when I exec
# flutter pub add infinite_scroll_pagination
I receive this error:
In my pubspec.yml I have :
If I substitute *isar_version with ^3.0.1 all works.