You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get the typescript error "Type '(fields: ContentFields) => Promise<string | undefined>' is not assignable to type '(fromFields: ContentFields) => string'.
Type 'Promise<string | undefined>' is not assignable to type 'string'.ts(2322)".
Possible Solution
Add Promise to type information for function.
Steps to Reproduce
Create a migration script which calls transformEntriesToType
Pass in a function for identityKey which returns a Promise
Try to compile with tsc
Context
Environment
Node Version: v14.19.3
Package Manager Version: yarn 1.18.0
Operating System: Arch Linux
Package Version: 4.8.1
The text was updated successfully, but these errors were encountered:
Expected Behavior
ITransformEntriesToTypeConfig should have the type definition for
identityKey
return a Promise as per https://github.com/contentful/contentful-migration/blob/master/src/lib/action/entry-transform-to-type.ts#L13.Actual Behavior
Get the typescript error "Type '(fields: ContentFields) => Promise<string | undefined>' is not assignable to type '(fromFields: ContentFields) => string'.
Type 'Promise<string | undefined>' is not assignable to type 'string'.ts(2322)".
Possible Solution
Add Promise to type information for function.
Steps to Reproduce
transformEntriesToType
identityKey
which returns a Promisetsc
Context
Environment
The text was updated successfully, but these errors were encountered: