aqueduct
aqueduct copied to clipboard
Dart 2.8.0-dev.18.0 Breaking change to the RuneIterator causes failure
Hi All,
First of all many thanks for this wonderful library.
On March 12th 2020, Dart team made a breaking change to their string.dart and more specifically to the RuneIterator which now returns -1 (instead of null) when the iterator hits the end.
As you are still referencing postgres: ^1.0.0 as a dependency, this change causes a failure of the ORM. However postgres version 2.1.0 will also fail.
This breaks the Aqueduct PostgreSQLFormat class (substituter.dart), at the level of the "substitute" static method, which expects a "null" value to stop iterating. When comes the "-1" value => Exception is thrown.
Possible solution is to change line #66, as follows:
while (iterator.current != null && iterator.current != -1) {
in order to be compliant with both previous and new version of the Dart sdk.
Kind Regards,
Didier
i believe this one is fixed on postgres version 2.1.1 https://github.com/stablekernel/postgresql-dart/issues/119 but im not sure how or is it posible to change aqueduct postgres depedencies
To anyone hosting on heroku: When following the tutorial here https://aqueduct.io/docs/deploy/deploy_heroku/ make sure to replace
heroku config:set DART_SDK_URL=https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip
with the explicit version
heroku config:set DART_SDK_URL=https://storage.googleapis.com/dart-archive/channels/stable/release/2.7.2/sdk/dartsdk-linux-x64-release.zip
Otherwise you will run into the exact issue mentioned above. It sure caused me some headaches. Hope this helps anyone.
If you want to use dart > 2.7.0, you can add to pubspec.yaml
:
dependency_overrides:
postgres: 2.1.1
To use aqueduct to upgrade the database:
pub run aqueduct db upgrade
I don't have problems to use aqueduct with recent PostgreSQL plugin.
But, Postgres aqueduct fails with dart 2.8.*
But, Postgres aqueduct fails with dart 2.8.*
I'm using Dart VM version: 2.9.0-8.2.beta (beta) (Tue May 12 09:05:56 2020 +0200) on "macos_x64"
and works great.
To anyone hosting on heroku: When following the tutorial here https://aqueduct.io/docs/deploy/deploy_heroku/ make sure to replace
heroku config:set DART_SDK_URL=https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip
with the explicit version
heroku config:set DART_SDK_URL=https://storage.googleapis.com/dart-archive/channels/stable/release/2.7.2/sdk/dartsdk-linux-x64-release.zip
Otherwise you will run into the exact issue mentioned above. It sure caused me some headaches. Hope this helps anyone.
Thanks a lot @timosettels that resolved my issue with deploying to heroku
@chrisoftech is everything good ? did you deployed your app in heroku without errors ?
Sorry for the late reply and yes @khalifa007 i was able to deploy to heroku following the aqueduct documentation but encountered an issue which was resolved by @timosettels comment here.
downgraded to Dart VM version: 2.7.2
If you want to use dart > 2.7.0, you can add to
pubspec.yaml
:dependency_overrides: postgres: 2.1.1
To use aqueduct to upgrade the database:
pub run aqueduct db upgrade
I don't have problems to use aqueduct with recent PostgreSQL plugin.
thanks, your comment helped me a lot I was stuck in the same problem for one day.
If you want to use dart > 2.7.0, you can add to
pubspec.yaml
:dependency_overrides: postgres: 2.1.1
To use aqueduct to upgrade the database:
pub run aqueduct db upgrade
I don't have problems to use aqueduct with recent PostgreSQL plugin.
Thanks. It's worked for me.
If you want to use dart > 2.7.0, you can add to
pubspec.yaml
:dependency_overrides: postgres: 2.1.1
To use aqueduct to upgrade the database:
pub run aqueduct db upgrade
I don't have problems to use aqueduct with recent PostgreSQL plugin.
not working now, same problem :(