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] Error while using JSX #585

Closed
2 tasks done
emkademy opened this issue Sep 12, 2024 · 5 comments · May be fixed by mbreadmachine/arany-d-osztaly-weboldal#69
Closed
2 tasks done

[BUG] Error while using JSX #585

emkademy opened this issue Sep 12, 2024 · 5 comments · May be fixed by mbreadmachine/arany-d-osztaly-weboldal#69
Labels
bug Something isn't working released

Comments

@emkademy
Copy link

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
I am getting the following error:

Error: $cloneWithProperties: LexicalJsxNode.clone(node) (with type 'jsx') did not return a node with the same key, make sure to specify node.__key as the last argument to the constructor

To Reproduce
Follow the JSX guide from the documentation.

Desktop (please complete the following information):

  • Ubuntu 22.04
  • Chrome
@emkademy emkademy added the bug Something isn't working label Sep 12, 2024
@petyosi
Copy link
Contributor

petyosi commented Sep 12, 2024

Can you give me a runnable sandbox?

@Tetragius
Copy link
Contributor

the error is reproduced when - npm run dev

IMG_5320.MOV

can be fixed by a correction in the LexicalJsxNode.tsx file on line 35 by replacing

return new LexicalJsxNode(structuredClone(node.__mdastNode))

with

return new LexicalJsxNode(node.__mdastNode,  node.__key)

@adambarito
Copy link

the error is reproduced when - npm run dev

IMG_5320.MOV
can be fixed by a correction in the LexicalJsxNode.tsx file on line 35 by replacing

return new LexicalJsxNode(structuredClone(node.__mdastNode))

with

return new LexicalJsxNode(node.__mdastNode,  node.__key)

Agree with this. It appears to have happened with the bump in Lexical version. I'm currently running a patched version with the additional node.__key variable and everything works great.

@petyosi
Copy link
Contributor

petyosi commented Sep 18, 2024

Can you open a PR? I will merge.

Tetragius added a commit to Tetragius/mdxeditor that referenced this issue Sep 18, 2024
Copy link

🎉 This issue has been resolved in version 3.11.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants