Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

Cannot read properties of undefined (reading 'replace')

Open wicgee opened this issue 10 months ago • 1 comments

Before opening, please confirm:

Operating System

macOS 26.1

Kiro Version

0.8.140

Bug Description

Image

When trying to select my code as context in Kiro IDE

  1. Right-click and select the code blocks in each of my files.
  2. Select "Kiro" > "Chat"

the chat dialog appears with message: "We've encountered an unknown error Cannot read properties of undefined (reading 'replace')"

Steps to Reproduce

Bug Reproduction: When selecting a file containing spaces, such as hello world.md, the error "Cannot read properties of undefined (reading 'replace')" occurs.

But if I remove the spaces from the file, such as helloworld.md, the error doesn't occur.

Expected Behavior

Files containing spaces will cause errors; removing the spaces will prevent these errors.

Conversation ID

No response

Additional Context

hello world.md hello world.py hello_world.py hello-world.md

This is the file I tested.

Below is my Kiro version. Version: 0.8.140 VSCode Version: 1.103.2 Commit: e9761ecebe507c32c4eefdc1f4f0a85a2bb29529 Date: 2026-01-16T00:53:18.181Z (1 wk ago) Electron: 37.10.2 ElectronBuildId: undefined Chromium: 138.0.7204.251 Node.js: 22.21.1 V8: 13.8.258.32-electron.0 OS: Darwin arm64 25.1.0

wicgee avatar Jan 27 '26 04:01 wicgee

Hey 👋 , Thanks for raising this. We are already tracking this issue here #2225. Feel free to upvote or add comment there.

AnilMaktala avatar Feb 02 '26 14:02 AnilMaktala