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

Cannot copy and paste tsx code into code block #1210

Open
imaimai17468 opened this issue Nov 2, 2024 · 0 comments
Open

Cannot copy and paste tsx code into code block #1210

imaimai17468 opened this issue Nov 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@imaimai17468
Copy link

imaimai17468 commented Nov 2, 2024

Describe the bug

I tried to copy and paste a tsx I wrote in VSCode into a code block and got the following error.

Uncaught (in promise) ShikiError: Language `typescriptreact` not found, you may need to load it first
    at Object.getLanguage (index.mjs:1773:13)
    at codeToTokensBase (index.mjs:840:29)
    at codeToTokens (index.mjs:1160:14)
    at Object.codeToTokens (index.mjs:1881:39)
    at parser (shiki.js:13:36)
    at parser (blocknote.js:6962:309)
    at eval (index.js:173:29)
    at Fragment.nodesBetween (index.js:105:31)
    at Node.nodesBetween (index.js:1238:22)
    at Fragment.nodesBetween (index.js:107:23)
    at Node.nodesBetween (index.js:1238:22)
    at Fragment.nodesBetween (index.js:107:23)
    at Node.nodesBetween (index.js:1238:22)
    at Node.descendants (index.js:1245:14)
    at calculateDecoration (index.js:162:7)
    at Plugin.apply (index.js:112:41)
    at EditorState.applyInner (index.js:851:45)
    at EditorState.applyTransaction (index.js:811:45)
    at EditorState.apply (index.js:787:21)
    at fe.dispatchTransaction (index.js:4575:34)
    at EditorView.dispatch (index.js:5698:33)
    at doPaste (index.js:3633:10)
    at EditorView.pasteHTML (index.js:5644:16)
    at fr (blocknote.js:10067:60)
    at Plugin.paste (blocknote.js:10094:24)
    at eval (index.js:3095:26)
    at EditorView.someProp (index.js:5498:50)
    at runCustomHandler (index.js:3093:17)
    at view.dom.addEventListener.view.input.eventHandlers.<computed> (index.js:3062:53)

To Reproduce

This bug can also be reproduced in the initial code of stackblitz, the template for this issue.
It can also be reproduced in the demo on the official Blocknote page (https://www.blocknotejs.org/).

2024-11-03.4.33.35.mov

Misc

  • Node version: -
  • Package manager: -
  • Browser:
    • Arc
    • version1.67.0 (55463)
    • Chromium Engine Version 130.0.6723.92
    • (The same problem occurs in Chrome.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant