microsoft / microsoft/azurechat
Response featuring code throws TypeError: Attempted to assign to readonly property
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 1
Description
I deployed azure chat locally following the docs.
I asked the question: "Imagine you are a python programmer. I want to use shell sort to sort a list of names. Can you provide a concise and fast algorithm to do it."
The response seemed to come back but the template failed to render it, possibly something about wrapping the answer in a code block:
Unhandled Runtime Error
TypeError: Attempted to assign to readonly property.
Source
components/chat/chat-row.tsx (107:18) @ code
105 | }
106 |
107 | children[0] = (children[0] as string).replace("
▍", "▍");
|^
108 | }
109 |
110 | const match = /language-(\w+)/.exec(className || "");
TypeError: Cannot assign to read only property '0' of string 'sort()'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in components/chat/chat-row.tsx at line 107 and reproduce the reported response containing a shell-sort code block. Inspect how the code response is handled around children[0], then verify that the template renders code responses without the readonly-property TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100