Skip to content

fix: add error logging for code highlighting failures#951

Open
hobostay wants to merge 1 commit intopingdotgg:mainfrom
hobostay:fix/chatmarkdown-highlight-error-logging
Open

fix: add error logging for code highlighting failures#951
hobostay wants to merge 1 commit intopingdotgg:mainfrom
hobostay:fix/chatmarkdown-highlight-error-logging

Conversation

@hobostay
Copy link

@hobostay hobostay commented Mar 12, 2026

Summary

Add error logging for Shiki code highlighting failures to help debug language-specific issues.

Changes

  • ChatMarkdown.tsx: Log highlighting failures while still falling back to plain text

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Note

Add error logging for code highlighting failures in SuspenseShikiCodeBlock

  • Captures the caught error in the SuspenseShikiCodeBlock catch block by changing catch {} to catch (error) {} in ChatMarkdown.tsx.
  • Adds a console.warn call to log the language and error on highlight failure.
  • Risk: The console.warn and referenced identifiers (language, error) are placed outside any valid scope in the current diff, which will cause a build/parse failure for the module.

Macroscope summarized 6488ae4.

Logs Shiki highlighting failures to help debug language-specific issues
while still falling back to plain text rendering.
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ee2bf5ac-7e6f-43a1-981c-bcaa9f372ef1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant