#Datastore.save giving Error saving post [TypeError: Cannot read property 'prototype' of undefined]

3 messages · Page 1 of 1 (latest)

twin zenith
#

Schema is :
type UserInfo @model{
id: ID!
title: String!
status: PostStatus!
rating: Int
content: String
}

I hit the command
amplify codegen models

here is the code

try {
console.log("first")
const post = await DataStore.save(
new UserInfo({
title: 'My First Post',
rating: 10,
status: "ACTIVE"
})
);
console.log('Post saved successfully!', post);
} catch (error) {
console.log('Error saving post', error);
}

tight current
#

Same for me, did you solved it?

twin zenith
#

rebuilding of app work for me