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

Sometimes messages lose code #32

Closed
tarasglek opened this issue May 2, 2023 · 7 comments · Fixed by #36
Closed

Sometimes messages lose code #32

tarasglek opened this issue May 2, 2023 · 7 comments · Fixed by #36

Comments

@tarasglek
Copy link
Owner

image

No idea what causes this, guessing it's something to do with serialization/deserialization as it started happening after one of the recent refactors.

@humphd
Copy link
Collaborator

humphd commented May 2, 2023

I can't reproduce locally or on chatcraft.org. I tried with both gpt-3.5 and gpt-4:

Screenshot 2023-05-02 at 8 02 56 AM

Screenshot 2023-05-02 at 8 04 09 AM

I wonder if we're hitting react-syntax-highlighter/react-syntax-highlighter#513 upstream.

@humphd
Copy link
Collaborator

humphd commented May 2, 2023

Refreshing a few times I can get it:

Screenshot 2023-05-02 at 8 14 36 AM

Refreshing again and it's working.

@tarasglek
Copy link
Owner Author

yeah it's been hard to repro here too.

@humphd
Copy link
Collaborator

humphd commented May 2, 2023

Seems to only happen for me in a production build, which is why I've never hit it (I tend to play with this locally in development). I've confirmed that it's not coming from our code. When we hit it, we aren't passing down '[object Object]' but the actual code we want to work with:

Screenshot 2023-05-02 at 8 33 21 AM

It's happening once we hand it off to the component here: https://github.com/tarasglek/chatcraft.org/blob/main/src/components/Markdown.tsx#L161

I'm trying to trace it through, to see if I can spot something.

@tarasglek
Copy link
Owner Author

Linking your post to react-syntax-highlighter/react-syntax-highlighter#513

@humphd
Copy link
Collaborator

humphd commented May 2, 2023

Unfortunately, the react-syntax-highlighter repo looks unmaintained to me. I cloned it and tried updating some things, but it's very out of date, and APIs have changed all over the place.

Probably we should explore other options, but everything I've looked at today is missing pieces that this one has. I'm not sure that there is a good drop-in replacement, so we'll have to get it working again with something new.

@tarasglek
Copy link
Owner Author

prismjs does seem to have an autoloader plugin. https://prismjs.com/plugins/autoloader/
I used it before, didn't run into show-stopper glitches, just couldn't find autoloader before.

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.

2 participants