Skip to content
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

Please don't use yaml references &isar_version in the pubspec.yaml, it is not supported by flutter pub #107

Open
3 tasks done
SP-XD opened this issue Sep 23, 2024 · 1 comment
Assignees

Comments

@SP-XD
Copy link

SP-XD commented Sep 23, 2024

Steps to Reproduce

Yaml reference used in the docs for adding the isar community version isar_version: &isar_version 3.1.8 breaks flutter pub add. Manually editing pubspec and adding packages works, but that's cumbersome.
Dart already has a issue filled you check here : issue. Current solution is to manually set the version number for the 3 packages.

Bug

Output of flutter pub add random_package after adding using yaml reference

Encountered an alias node along [dependencies, isar, version]! Alias nodes are nodes that refer to a previously serialized nodes, and are denoted by either the "*" or the "&" indicators in the original YAML. As the resulting behavior of mutations on these nodes is not well-defined, the operation will not be supported by this library.

line 9, column 15: The alias was first defined here.
  ╷
9 │ isar_version: &isar_version 3.1.8
  │               ^^^^^^^^^^^^^^^^^^^
  ╵
package:yaml_edit/src/editor.dart 514:34                        YamlEditor._assertNoChildAlias
package:yaml_edit/src/editor.dart 532:9                         YamlEditor._assertNoChildAlias
package:yaml_edit/src/editor.dart 532:9                         YamlEditor._assertNoChildAlias
package:yaml_edit/src/editor.dart 498:21                        YamlEditor._traverse
package:yaml_edit/src/editor.dart 255:24                        YamlEditor.update
package:pub/src/command/add.dart 715:20                         AddCommand._updatePubspec
package:pub/src/command/add.dart 242:28                         AddCommand.runProtected
===== asynchronous gap ===========================
package:pub/src/command.dart 196:7                              PubCommand.run
===== asynchronous gap ===========================
package:args/command_runner.dart 212:13                         CommandRunner.runCommand
===== asynchronous gap ===========================
package:dartdev/dartdev.dart 236:18                             DartdevRunner.runCommand
===== asynchronous gap ===========================
package:dartdev/dartdev.dart 47:16                              runDartdev
===== asynchronous gap ===========================
/Volumes/Work/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart 13:5  main
This is an unexpected error. The full log and other details are collected in:

    /Users/somnathpaul/.pub-cache/log/pub_log.txt

Consider creating an issue on https://github.com/dart-lang/pub/issues/new
and attaching the relevant parts of that log file.

Details

❯ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (1 available)
[✓] Network resources


  • I searched for similar issues already
  • I filled the details section with the exact device model and version
  • I am able to provide a reproducible example
@vicenterusso vicenterusso self-assigned this Sep 29, 2024
@mrverdant13
Copy link

mrverdant13 commented Oct 1, 2024

That's right
That approach does not work
But this one does:

dependencies:
  isar: &isar_dependency
    hosted: https://pub.isar-community.dev/
    version: 3.1.8

dev_dependencies:
  isar_generator: *isar_dependency

UPDATE:
Never mind, it does not work when using dart pub sub-comands or other kind of indirect pubspec mutation actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants