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

Error while trying to run dart run moor_generator migrate #2911

Open
Shashank-Girish opened this issue Mar 5, 2024 · 4 comments
Open

Error while trying to run dart run moor_generator migrate #2911

Shashank-Girish opened this issue Mar 5, 2024 · 4 comments

Comments

@Shashank-Girish
Copy link

Hi, I am migrating my app from flutter 3.0.1 to 3.19.0 and all the packages within. While trying to migrate from moor to drift using dart run moor_generator migrate , I encountered the following error

Failed to build moor_generator:moor_generator:
../../../.pub-cache/hosted/pub.dev/moor_generator-4.6.0+1/bin/moor_generator.dart:1:1: Error: Library doesn't support null safety.
//@dart=2.9

The following are my versions in pubspec.yaml
moor_flutter: ^4.0.0
moor_generator: ^4.6.0

Any idea how to solve this?

@simolus3
Copy link
Owner

simolus3 commented Mar 5, 2024

Hm, you might have to migrate to drift on the older Flutter version and do the upgrade afterwards.
I haven't tried this, but what might also work is adding a dependency on drift_dev right away and then running dart run drift_dev migrate instead.

@Shashank-Girish
Copy link
Author

I tried it, didn't work. Same error persisted.

@simolus3
Copy link
Owner

Really, the same error? With moor_generator appearing in the error message? Did you run dart run drift_dev migrate? Drift is fully migrated to null safety so this surprises me.

@Shashank-Girish
Copy link
Author

Yeah, the same error persisted, so I manually migrated off

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

2 participants