Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[StoryblokRichText] Rendering immutable richText object #1353

Open
1 task done
7alip opened this issue Feb 27, 2025 · 0 comments
Open
1 task done

[StoryblokRichText] Rendering immutable richText object #1353

7alip opened this issue Feb 27, 2025 · 0 comments
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised

Comments

@7alip
Copy link

7alip commented Feb 27, 2025

Describe the issue you're facing

We encountered an issue where the StoryblokRichText and richTextResolver's render function do not support immutable Storyblok data.

Our setup uses Apollo GraphQL to fetch Storyblok content. In production, certain pages were throwing errors in specific languages. After investigation, we found that the issue likely stemmed from Apollo’s immutable response structure. We resolved this by wrapping all Storyblok content with cloneDeep.

To further diagnose the issue, we created a minimal reproduction and found that the error occurs when the rich text contains attributes.

Would it be possible for Storyblok to handle this internally to ensure compatibility with immutable data sources?

Reproduction

https://stackblitz.com/edit/bb-storblok

Steps to reproduce

No response

System Info

@storyblok/react@^4.4.0

Used Package Manager

yarn

Error logs (Optional)

storyblok-js.mjs:991 Uncaught TypeError: Cannot add property key, object is not extensible
    at eval (storyblok-js.mjs:991:24)
    at x (storyblok-js.mjs:1114:12)
    at Array.map (<anonymous>)
    at C (storyblok-js.mjs:1121:45)
    at eval (storyblok-rich-text.mjs:17:13)
    at renderWithHooks (react-dom.development.js:10707:18)
    at updateForwardRef (react-dom.development.js:14692:20)
    at beginWork$1 (react-dom.development.js:17392:16)
    at HTMLUnknownElement.callCallback (react-dom.development.js:19462:14)
    at Object.invokeGuardedCallbackImpl (react-dom.development.js:19511:16)
    at invokeGuardedCallback (react-dom.development.js:19586:29)
    at beginWork (react-dom.development.js:25724:7)
    at performUnitOfWork (react-dom.development.js:24553:12)
    at workLoopSync (react-dom.development.js:24269:5)
    at renderRootSync (react-dom.development.js:24224:7)
    at performSyncWorkOnRoot (react-dom.development.js:23701:20)
    at flushSyncWorkAcrossRoots_impl (react-dom.development.js:9975:13)
    at flushSyncWorkOnAllRoots (react-dom.development.js:9933:3)
    at processRootScheduleInMicrotask (react-dom.development.js:10077:3)
    at eval (react-dom.development.js:10248:7)

Validations

@7alip 7alip added pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

1 participant