aqueduct icon indicating copy to clipboard operation
aqueduct copied to clipboard

Dart 2.8.0-dev.18.0 Breaking change to the RuneIterator causes failure

Open boeledi opened this issue 4 years ago • 11 comments

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

boeledi avatar Apr 13 '20 08:04 boeledi

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

itsnuba avatar May 12 '20 06:05 itsnuba

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.

timosettels avatar May 14 '20 14:05 timosettels

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.

edufolly avatar May 28 '20 14:05 edufolly

But, Postgres aqueduct fails with dart 2.8.*

jairoFernandez avatar May 29 '20 23:05 jairoFernandez

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.

edufolly avatar May 29 '20 23:05 edufolly

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

kwado-tech avatar Jun 05 '20 06:06 kwado-tech

@chrisoftech is everything good ? did you deployed your app in heroku without errors ?

khalifa007 avatar Jun 05 '20 09:06 khalifa007

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

kwado-tech avatar Jun 07 '20 03:06 kwado-tech

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.

HusseinReda97pro avatar Jun 16 '20 08:06 HusseinReda97pro

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.

CoderJava avatar Jul 12 '20 14:07 CoderJava

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 :(

fabioselau077 avatar Feb 08 '21 04:02 fabioselau077