Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for @contentful/app-sdk

See original GitHub issue

I am working on creating an entry editor for some content model. I am using @contentful/app-sdk and @contentful/forma-36-react-components. I am able to have the UI the way I want with the forma-36 components but I also want to use @contentful/field-editor-reference to have access to the original functionality of the field.

The problem I am running into is when I pass sdk to the MultipleEntryReferenceEditor component from @contentful/field-editor-reference. I get the following error

Type ‘import("/node_modules/@contentful/app-sdk/dist/types").FieldExtensionSDK’ is not assignable to type ‘import("/node_modules/contentful-ui-extensions-sdk/dist/types").FieldExtensionSDK’.

I believe Contentful recommends using @contentful/app-sdk over contentful-ui-extensions-sdk but @contentful/field-editor-reference has a transient dependency on contentful-ui-extensions-sdk.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

tonyneel923commented, Jul 8, 2021

In case anyone comes across this bug as well you can hack a solution together from entry editor sdk like so

const sdkCast: FieldExtensionSDK  = {
    field: sdk.entry.fields["fieldName"].getForLocale('en-US')
  } as FieldExtensionSDK
tonyneel923commented, Jul 7, 2021

@suevalov if I run yarn add @contentful/field-editor-reference@latest and then pass sdk from entry editor to MultipleEntryReferenceEditor I get the same error as above.

What is the way to fix this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

App SDK Reference - Contentful
The SDK reference guide for Apps and UI Extensions | Inclusion | Initialization | Locations | Fields and Entries | Content types.
Read more >
@contentful/app-sdk - npm
The App SDK (formerly known as UI Extensions SDK) is a JavaScript library that allows developers to create custom Contentful Apps for the...
Read more >
Creating a customized view of Contentful checkbox
Now in your top right corner click the Install button, wait for it to be installed and Save. Next go to your Content...
Read more >
Building a Custom Contentful App that Invokes an External API
Create a new content type and then add a new field. For this app in particular JSON Object must be chosen as that...
Read more >
Adding installation parameters to a contentful App
I can see how to get them from the SDK but settings them i cant. any help is much appreciated. contentful · contentful-management...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found