-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
AngularRelated to Angular 2+Related to Angular 2+BuildRelated to build issuesRelated to build issuesDataStoreRelated to DataStore categoryRelated to DataStore categorypending-maintainer-responseIssue is pending a response from the Amplify team.Issue is pending a response from the Amplify team.questionGeneral questionGeneral questiontransferredThis issue was transferred from another Amplify projectThis issue was transferred from another Amplify project
Description
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.15.1
Amplify CLI Version
12.12.4
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
I am using Amplify with Angular and Ionic. As I perform "ng build" I get the following error:
Error: node_modules/@aws-amplify/datastore/dist/esm/types.d.ts:256:363 - error TS2536: Type '"field"' cannot be used to index type 'MetadataOrDefault<T, M>["identifier"]'.
256 export type IdentifierFields<T extends PersistentModel, M extends PersistentModelMetaData<T> = never> = (MetadataOrDefault<T, M>['identifier'] extends ManagedIdentifier<any, any> | OptionallyManagedIdentifier<any, any> ? MetadataOrDefault<T, M>['identifier']['field'] : MetadataOrDefault<T, M>['identifier'] extends CompositeIdentifier<T, infer B> ? B[number] : MetadataOrDefault<T, M>['identifier']['field']) & string;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@aws-amplify/datastore/dist/esm/types.d.ts:305:305 - error TS2536: Type 'MetadataOrDefault<T, M>["identifier"]["field"]' cannot be used to index type 'T'.
305 export type IdentifierFieldValue<T extends PersistentModel, M extends PersistentModelMetaData<T>> = MetadataOrDefault<T, M>['identifier'] extends CompositeIdentifier<T, any> ? MetadataOrDefault<T, M>['identifier']['fields'] extends [any] ? T[MetadataOrDefault<T, M>['identifier']['fields'][0]] : never : T[MetadataOrDefault<T, M>['identifier']['field']];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/@aws-amplify/datastore/dist/esm/types.d.ts:305:307 - error TS2536: Type '"field"' cannot be used to index type 'MetadataOrDefault<T, M>["identifier"]'.
305 export type IdentifierFieldValue<T extends PersistentModel, M extends PersistentModelMetaData<T>> = MetadataOrDefault<T, M>['identifier'] extends CompositeIdentifier<T, any> ? MetadataOrDefault<T, M>['identifier']['fields'] extends [any] ? T[MetadataOrDefault<T, M>['identifier']['fields'][0]] : never : T[MetadataOrDefault<T, M>['identifier']['field']];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expected behavior
No errors
Reproduction steps
- Start from an new amplify project
- Set up the package.json file as the attached one.
- npm i
- ng build
Project Identifier
9a1c6b8ab468bb739b4aaa401ebab656
Log output
# Put your logs below this line
Additional information
No response
Before submitting, please confirm:
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I have removed any sensitive information from my code snippets and submission.
Metadata
Metadata
Assignees
Labels
AngularRelated to Angular 2+Related to Angular 2+BuildRelated to build issuesRelated to build issuesDataStoreRelated to DataStore categoryRelated to DataStore categorypending-maintainer-responseIssue is pending a response from the Amplify team.Issue is pending a response from the Amplify team.questionGeneral questionGeneral questiontransferredThis issue was transferred from another Amplify projectThis issue was transferred from another Amplify project