Sdk: cannot resolve class 'ChunkedConverter' from 'HexEncoder'

Created on 3 May 2017  路  5Comments  路  Source: dart-lang/sdk

pub global activate den causes

Precompiling executables... 
Failed to precompile den:den:
'package:convert/src/hex/encoder.dart': malformed type: line 20 pos 13: cannot resolve class 'ChunkedConverter' from 'HexEncoder'
    extends ChunkedConverter<List<int>, String, List<int>, String> {
            ^
Dart VM version: 1.24.0-edge.6a575117630f40859b4fc034696e9a14486501d6 (Wed May  3 01:40:41 2017) on "linux_x64"

den doesn't seem to use ChunkedConverter or HexEncoder, at least not directly.
pub cache repair didn't fix it either.

area-library

Most helpful comment

The ChunkedEncoder class has been removed (it was deprecated in 1.17, after being added in 1.16), but it means that you need to depend on package:convert version 2.0 for Dart v 1.24, since convert v1.1.1 uses ChunkedEncoder.

This is complicating versioning because the removal of the deprecated ChunkedEncoder class was technically a breaking change, so to be consistent with semantic versioning, it shouldn't have been able to happen until 2.0, but we are reserving that number for a larger change.

Could we release a patch (or less significant) version of package:convert that changes its SDK requirement to <1.24? (@munificent, @nex3)

All 5 comments

The ChunkedEncoder class has been removed (it was deprecated in 1.17, after being added in 1.16), but it means that you need to depend on package:convert version 2.0 for Dart v 1.24, since convert v1.1.1 uses ChunkedEncoder.

This is complicating versioning because the removal of the deprecated ChunkedEncoder class was technically a breaking change, so to be consistent with semantic versioning, it shouldn't have been able to happen until 2.0, but we are reserving that number for a larger change.

Could we release a patch (or less significant) version of package:convert that changes its SDK requirement to <1.24? (@munificent, @nex3)

we are reserving that number for a larger change

sounds like you are mixing "old-style" versioning with semantic versioning.
Seems like a path into a lot of troubles to me.

Could we release a patch (or less significant) version of package:convert that changes its SDK requirement to <1.24?

You could, but it may not fix the problem. Users of Dart SDK 1.24 or greater would see pub simply skip past that version (correctly, because it doesn't support their SDK) and land them back on the version that claims to work with 1.24 but doesn't actually.

There may not be a very easy solution. 馃槥 Semantic versioning is a game that only really works when everyone agrees to play by the rules. When you publish a package, its dependencies often permit versions that don't exist yet. They do that based on the assumption that the dependent package won't include breaking changes in those versions. If that turns out to not be true, there isn't a mechanism in place to retroactively narrow the dependency ranges in those previously-published packages.

One option is to publish convert 1.1.2 with a constraint that still allows SDK 1.24. But the package itself is emptied out and replaced with a message saying, "You need to switch to the 2.0.0 version." When users pub upgrade, pub will pick that version and then the users will see their app has a bunch of errors. They have to then manually change their dependency on convert and upgrade to the 2.x line.

Kind of an unpleasant user experience, but it forcibly gets them off the busted 1.x line.

We aren't going to take any actions, so closing.

(Again: sorry about the inconveniences).

in pubspec.yaml, add following dependencies, then you are good to go.
convert: ^2.0.1

Was this page helpful?
0 / 5 - 0 ratings