# Fix crash when rendering code blocks with unsupported languages \(\#266 & \#210\) \(\#279\) · screen/t3code-personal

[View on GitCafe](https://git.cafe/screen/t3code-personal/commit/0a902790cacb20d38c6f36fe331ac283a2c74b0f)

Repository: [screen/t3code-personal](https://git.cafe/screen/t3code-personal)

Visibility: public

Requested revision: 0a902790cacb20d38c6f36fe331ac283a2c74b0f

Requested commit: 0a902790cacb20d38c6f36fe331ac283a2c74b0f

Commit: 0a902790cacb20d38c6f36fe331ac283a2c74b0f

Tree: 34cf6c134bb2d78857282765c395c3bf877daaaf

Author: Ahmed R\.

Committer: GitHub

## Message

```
Fix crash when rendering code blocks with unsupported languages (#266 & #210) (#279)

The app crashed when displaying code blocks with language identifiers
not bundled in Shiki (e.g. "env" from .env file edits). The language
string was cast to SupportedLanguages without validation, causing
resolveLanguage to throw an unhandled error that killed the thread.

Three layers of defense added:
- getHighlighterPromise falls back to "text" when Shiki rejects
- codeToHtml call wrapped in try/catch with "text" fallback
- CodeHighlightErrorBoundary prevents component tree crashes

Closes #266

Co-authored-by: Ahmed R <Ahmed@Ahmeds-MacBook-Pro.local>
```

## Parents

- [0837c8b639f3fb54c155d824c308c6b03038fa9c](https://git.cafe/screen/t3code-personal/commit/0837c8b639f3fb54c155d824c308c6b03038fa9c?format=markdown)

[Source at this commit](https://git.cafe/screen/t3code-personal/tree/0a902790cacb20d38c6f36fe331ac283a2c74b0f?format=markdown)
