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

[BUG] <elements> #450

Open
1 task done
Rockstar2K opened this issue Feb 10, 2025 · 1 comment
Open
1 task done

[BUG] <elements> #450

Rockstar2K opened this issue Feb 10, 2025 · 1 comment

Comments

@Rockstar2K
Copy link

Has this bug been raised before?

  • I have checked "open" AND "closed" issues and this is not a duplicate

Description

cant get rid of this error. even trying examples from the web. much less with my own implementation. i literally just copy-pasted the full setup example

ERROR
Cannot read properties of undefined (reading 'elements')
TypeError: Cannot read properties of undefined (reading 'elements')
at K (http://localhost:3000/static/js/bundle.js:171218:25)
at http://localhost:3000/static/js/bundle.js:181081:27
at Array.forEach ()
at http://localhost:3000/static/js/bundle.js:181076:42
at http://localhost:3000/static/js/bundle.js:181087:10
at mountState (http://localhost:3000/static/js/bundle.js:90850:24)
at Object.useState (http://localhost:3000/static/js/bundle.js:91455:20)
at useState (http://localhost:3000/static/js/bundle.js:110147:25)
at vs (http://localhost:3000/static/js/bundle.js:181036:63)
at renderWithHooks (http://localhost:3000/static/js/bundle.js:90271:22)

Screenshots

No response

Do you want to work on this issue?

No

@xhypeDE
Copy link

xhypeDE commented Feb 11, 2025

I encountered the same issue and, as I suspected, it turned out not to be a problem with the package itself but rather with how the editor’s initial value is set and how content is passed in. To fix this, you need to ensure that the value prop follows the specific data shape required by Yoopta Editor. You can find an example in initValue.ts. Once I adjusted my initialValue to match that format, the error disappeared. I hope this helps, as I stumbled upon your post while debugging the very same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants