[BUG] Bug report: Claude Desktop crashes on streaming powershell code blocks
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
Diagnostics
Currently running: native (2.1.111)
Path: C:\Users\pavel.dudko\AppData\Roaming\Claude\claude-code\2.1.111\claude.exe
Config install method: native
Search: OK (bundled)
Updates
Auto-updates: enabled
Auto-update channel: latest
Stable version: 2.1.104
Latest version: 2.1.116
OS: Windows Server 2022 Standard, 10.0.20348
Claude Desktop app: 1.3561.0
- Product: Claude Desktop (Windows)
- App version: 1.3561.0
- Install path:
C:\Users\<user>\AppData\Local\AnthropicClaude\app-1.3561.0\ - OS: Windows Server 2022 Standard, 10.0.20348
Summary
The renderer process emits a cascade of unhandled promise rejections, then hits Fatal error boundary, whenever an assistant message streams a fenced code block tagged `powershell . Short aliases (ps1, pwsh, bash) do not reproduce.
Root cause (from logs)
The Shiki-based syntax highlighter appears to call resolveLanguage(tag) on every partial prefix as the language tag streams in. For powershell that is 10 calls, each throwing:
Uncaught (in promise) Error: resolveLanguage: "p" not found in bundled or custom languages
Uncaught (in promise) Error: resolveLanguage: "po" not found in bundled or custom languages
Uncaught (in promise) Error: resolveLanguage: "pow" not found in bundled or custom languages
Uncaught (in promise) Error: resolveLanguage: "powe" not found in bundled or custom languages
Uncaught (in promise) Error: resolveLanguage: "power" not found in bundled or custom languages
Uncaught (in promise) Error: resolveLanguage: "powers" not found in bundled or custom languages
Uncaught (in promise) Error: resolveLanguage: "powersh" not found in bundled or custom languages
Uncaught (in promise) Error: resolveLanguage: "powershe" not found in bundled or custom languages
Rejections accumulate → [BOOTSTRAP] Fatal error boundary triggered → renderer dies / white-screens.
Log evidence
File: %APPDATA%\Claude\logs\claude.ai-web.log
Matching resolveLanguage rejections (each coincides with a powershell code block rendering in chat):
- 2026-04-21 10:29:02 — 5 rejections
- 2026-04-21 10:33:09–10 — 5 rejections
- 2026-04-21 10:35:44 — 3 rejections
- 2026-04-21 10:38:14 — 3 rejections
Associated boundary crashes in the same log (earlier, heavier-use dates):
- 2026-03-04 11:43:46 – 20:05:22 — ~15
[BOOTSTRAP] Fatal error boundary triggeredentries - 2026-03-05 21:48:09 – 21:48:19
- 2026-03-10 13:59:59 – 14:00:17
Stack trace of a representative fatal error (from claude.ai-web.log):
[error] Uncaught Error: Minified React error #418; visit https://react.dev/errors/418 ...
Steps to reproduce
- Have the assistant emit a fenced code block tagged
`powershell(e.g. ask "give me a PowerShell one-liner to list services"). - Observe
%APPDATA%\Claude\logs\claude.ai-web.log—resolveLanguagerejections appear as the tag streams character by character. - Over a session, accumulated rejections cause the renderer to hit Fatal error boundary and the chat view crashes / reloads.
Expected behavior
Language tag resolution should either:
- wait until the opening fence is complete (newline seen) before resolving, or
- swallow rejections for partial/unknown tags silently, or
- pre-register the full Shiki alias set so partial matches return a placeholder.
Workaround
Users can prompt the model to use ps1 or pwsh instead of powershell. Shorter tag = 3 partial resolutions instead of 10, which does not accumulate enough to crash.
Likely broader impact
Any language tag longer than ~5 characters will emit extra rejections: typescript, javascript, markdown, dockerfile, yaml (borderline), etc. Worth auditing for those too — powershell just happens to be the longest common one and is thus the first to cross whatever threshold triggers the boundary.
Suggested code location
Whatever wraps Shiki's resolveLanguage in index-BKPqcTdh.js (seen in stack traces from assets-proxy.anthropic.com/claude-ai/v2/assets/v1/). A try/catch around the streaming-tag path, or debouncing resolution until the fence line closes, should fix it.
What Should Happen?
Streaming a fenced code block with the ```powershell language tag should highlight the block without crashing the renderer.
Specifically, Shiki's resolveLanguage call should either:
- wait until the opening fence line is complete (newline seen) before attempting to resolve the tag, or
- silently ignore unknown partial tags during streaming instead of throwing unhandled promise rejections, or
- have every known language + alias pre-registered so partial-prefix lookups return a safe placeholder.
No Uncaught (in promise) errors should appear in claude.ai-web.log, and no Fatal error boundary should be triggered as a result of normal code block rendering.
Error Messages/Logs
Steps to Reproduce
- Open Claude Desktop on Windows (v1.3561.0).
- Start a new chat and ask the assistant to produce a PowerShell snippet, e.g. "give me a PowerShell one-liner to list running services".
- The assistant streams a response containing a fenced code block opened with ```powershell.
- While the language tag is streaming character-by-character, observe %APPDATA%\Claude\logs\claude.ai-web.log — a series of "Uncaught (in promise) Error: resolveLanguage: \"p\" ... \"po\" ... \"pow\" ... \"powershe\" not found in bundled or custom languages" entries appear, one per partial prefix.
- Repeat across several messages / sessions. Rejections accumulate and eventually [BOOTSTRAP] Fatal error boundary triggered is logged and the chat view crashes / white-screens / reloads.
Does NOT reproduce when the assistant uses shorter language tags such as ``ps1, `pwsh, or ``bash — only 2–3 partial-prefix rejections fire, which is not enough to trigger the boundary.
Reproducible log timestamps from my environment (claude.ai-web.log):
- 2026-04-21 10:29:02, 10:33:09, 10:35:44, 10:38:14 — resolveLanguage rejections on "powershell"
- 2026-03-04 11:43:46–20:05:22 — ~15 Fatal error boundary triggered entries during heavier use
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.111
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗