Search code examples
mongodbdartdart-pubdartson

Pubspec.yaml throwing inconsistent errors and no conflicts


I'm seeing an odd issue with Dartson & mongo_dart.

I was running mongo_dart 0.1.46. - I need to upgrade it to mongo_dart 0.2.4

However, when i upgrade mongo_dart - i get the following error about dartson

Package mongo_dart has no versions that match 0.2.4 derived from: - tickets depends on version 0.2.4

using:

dependencies:
#Server Dependencies
  json_object: "1.0.19"
  mongo_dart: "0.2.4"
  connection_pool: "0.1.0+2"
  dartson: "0.2.4"
  guinness: "0.1.17"
  html: "0.12.2"
  shelf: '>=0.6.2 <0.7.0'
  shelf_static: "0.2.2"
  shelf_route: "0.14.0"

This is odd, as mongo_dart: '0.2.4' exists on pub.dartlang, and it works in isolation https://pub.dartlang.org/packages/mongo_dart


By testing the removal of each individual package in pubspec.yaml, i was able to identify a conflict with dartson.

If i move dartson to the top of the dependency list i get the reverse:

dependencies:
#Server Dependencies
  dartson: "0.2.4"
  json_object: "1.0.19"
  mongo_dart: "0.2.4"
  connection_pool: "0.1.0+2"
  guinness: "0.1.17"
  html: "0.12.2"
  shelf: '>=0.6.2 <0.7.0'
  shelf_static: "0.2.2"
  shelf_route: "0.14.0"

Package dartson has no versions that match 0.2.4 derived from: - tickets depends on version 0.2.4

Removing dartson all together allows for mongo_dart to install correctly.

Is there a known issue between the two libraries? Is there a conflict thats not getting surfaced?

Question: How do i get mongo_dart 0.2.4 to run with Dartson 0.2.4


Solution

  • I've run pub get in verbose mode on your pubspec, the problems seems to be in different dependencies from package logging Dartson depends have dependency on version 0.9, mongo_dart on current version 0.11 You can ask dartson authors, have they some consideration about current version of logging

    Meanwhile you can try to add dependency_ovverride to your pubspec. When I added ovverride to your pubspec, it works for me

    name: test_pubspec
    
    dependencies:
      json_object: "1.0.19"
      mongo_dart: "0.2.4"
      connection_pool: "0.1.0+2"
      dartson: "0.2.4"
      guinness: "0.1.17"
      html: "0.12.2"
      shelf: '>=0.6.2 <0.7.0'
      shelf_static: "0.2.2"
      shelf_route: "0.14.0"
    dependency_overrides:
      logging: '^0.11.0'