microsoft / microsoft/azurechat

Response featuring code throws TypeError: Attempted to assign to readonly property

Open
#247 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.