Description
I've searched existing open issues and couldn't find anything, so here we go:
One day, I suddenly started getting build errors like the following that would completely block me from compiling my app:
lib/models/User.dart:386:49: Error: Member not found: 'IDENTITYPOOL'.
provider: amplify_core.AuthRuleProvider.IDENTITYPOOL,
I'd been running relatively outdated versions of all flutter the amplify libraries, 2.6.0 for most. I figured an upgrade to 2.11.0 would fix this (spoiler alert: it did not). Looking at the error however, it makes sense because if we look at the following line in my User.dart models file
provider: amplify_core.AuthRuleProvider.IDENTITYPOOL,
and go to auth_rule.dart, we can see::
enum AuthRuleProvider { APIKEY, OIDC, IAM, USERPOOLS, FUNCTION }
only IAM is available. I'm on the latest version of amplify cli
$ amplify --version
⚠️ WARNING: AWS Amplify Gen 1 CLI is in maintenance mode and will reach end of life on May 1, 2027.
During maintenance mode, only critical bug fixes and security patches will be provided.
Migrate to Amplify Gen 2: https://docs.amplify.aws/react/start/migrate-to-gen2/
14.4.0
and a amplify codegen models did not fix it. I have to manually go into my model fils and substitute IDENTITYPOOLS to IAM, then the compiler is happy.
So yeah, I'm very confused and also surprised that no one else has run into this?
Categories
Steps to Reproduce
- Create an empty folder and place the following in a file called
schema.graphql
type User @model @auth(rules: [
{ allow: private, provider: identityPool }
{ allow: owner }
]) {
id: String! @index
}
- Create a
pubspec.yaml with:
name: bug_repro
description: Amplify codegen IDENTITYPOOL bug reproduction
environment:
sdk: '>=3.0.0 <4.0.0'
dependencies:
flutter:
sdk: flutter
amplify_flutter: ^2.11.0
- Run a
flutter pub get
- Create
models directory mkdir models
- Run
codegen command
$ amplify codegen models flutter --target flutter --model-schema schema.graphql --output-dir models
⚠️ WARNING: AWS Amplify Gen 1 CLI is in maintenance mode and will reach end of life on May 1, 2027.
During maintenance mode, only critical bug fixes and security patches will be provided.
Migrate to Amplify Gen 2: https://docs.amplify.aws/react/start/migrate-to-gen2/
Skipping PreCodegenModels lifecycle event, due to presence of ["target","model-schema"] in context options
Successfully generated models. Generated models can be found in /Users/tobias/tmp/amplify-flutter-id-pool-bug/models
Skipping PostCodegenModels lifecycle event, due to presence of ["target","model-schema"] in context options
- Inspect
models/User.dart and it has the line:
provider: amplify_core.AuthRuleProvider.IDENTITYPOOL,
which is a problem because if you go to the AuthRuleProvider definition, there's no IDENTITYPOOL enumeration value, only IAM
Screenshots
No response
Platforms
Flutter Version
3.38.1
Amplify Flutter Version
2.11.0
Deployment Method
Amplify CLI (Gen 1)
Schema
type User @model @auth(rules: [
{ allow: private, provider: identityPool }
{ allow: owner }
]) {
id: String! @index
}
Description
I've searched existing open issues and couldn't find anything, so here we go:
One day, I suddenly started getting build errors like the following that would completely block me from compiling my app:
I'd been running relatively outdated versions of all flutter the amplify libraries, 2.6.0 for most. I figured an upgrade to 2.11.0 would fix this (spoiler alert: it did not). Looking at the error however, it makes sense because if we look at the following line in my User.dart models file
and go to auth_rule.dart, we can see::
only IAM is available. I'm on the latest version of amplify cli
and a
amplify codegen modelsdid not fix it. I have to manually go into my model fils and substitute IDENTITYPOOLS to IAM, then the compiler is happy.So yeah, I'm very confused and also surprised that no one else has run into this?
Categories
Steps to Reproduce
schema.graphqlpubspec.yamlwith:flutter pub getmodelsdirectorymkdir modelscodegencommandmodels/User.dartand it has the line:which is a problem because if you go to the
AuthRuleProviderdefinition, there's noIDENTITYPOOLenumeration value, onlyIAMScreenshots
No response
Platforms
Flutter Version
3.38.1
Amplify Flutter Version
2.11.0
Deployment Method
Amplify CLI (Gen 1)
Schema