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

Docusaurus in-browser -> Uncaught TypeError #26

Closed
gotohuman opened this issue May 7, 2024 · 5 comments · Fixed by #28
Closed

Docusaurus in-browser -> Uncaught TypeError #26

gotohuman opened this issue May 7, 2024 · 5 comments · Fixed by #28

Comments

@gotohuman
Copy link

Thanks for this great tool. I'm following your tutorial on how to integrate with docusaurus, but even after bumping up to v0.19.5 I'm getting a script error:

Uncaught TypeError: Cannot read properties of null (reading 'indexOf')
    at Object.J [as cut] (snippet.js:10:782)
    at new b (snippet.js:21:1146)
    at v.attributeChangedCallback (snippet.js:25:3770)
    at setValueForProperty (react-dom.development.js:798:14)
    at setInitialDOMProperties (react-dom.development.js:9720:7)
    at setInitialProperties (react-dom.development.js:9921:3)
    at finalizeInitialChildren (react-dom.development.js:10950:3)
    at completeWork (react-dom.development.js:22227:17)
    at completeUnitOfWork (react-dom.development.js:26630:16)
    at performUnitOfWork (react-dom.development.js:26602:5)

In the mypage.md I have integrated the codapi example like this:

[triple ticks]
POST https://httpbingo.org/dump/request
content-type: application/json

{
    "message": "hello"
}
[triple ticks]
<codapi-snippet engine="browser" sandbox="fetch" editor="basic" init-delay="500">
</codapi-snippet>
@gotohuman
Copy link
Author

I'm only seeing this locally, but not sure if the error is simply not logged in production.

When I dismiss the error, the script still seems to function btw.

@nalgeon
Copy link
Owner

nalgeon commented May 7, 2024

Sure! What is your Docusaurus version?

@gotohuman
Copy link
Author

It's 3.1.1

@nalgeon
Copy link
Owner

nalgeon commented May 7, 2024

Okay, thanks! I'll look into it when I have time.

@stephenfuqua
Copy link

For other readers: confirmed, release 0.19.7 fixes this Docusaurus issue, and a problem with line breaks.

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

Successfully merging a pull request may close this issue.

3 participants