aws / aws/amazon-q-developer-cli

Error approving file changes: Cannot read properties of null (reading 'length')

Open
#3,486 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 14.7.0 (23H124)

### Expected behaviour

Should be able to approve all file changes in directory without error

### Actual behaviour

When trying to approve file changes for entire directory, getting error: "Error invoking remote method 'approve-proposal': Error: [approve-proposal] Error: Error processing actions for message 88: TypeError: Cannot read properties of null (reading 'length')"

```
[chat-transcript]
> sua loi [plugin:vite:import-analysis] Failed to resolve import "./leads/modals.js" from "src/js/components/LeadDetail.js". Does the file exist?>
/Users/samnguyen/dyad-apps/sam-cskh-app/src/js/components/LeadDetail.js:252:21>
250| import('../services/staffService.js').then(async ({getAllStaff}) => {>
251| const staffList = await getAllStaff();>
252| import('./leads/modals.js').then(({showEditLeadModal}) => {>
| ^>
253| showEditLeadModal(lead, staffList, () => refresh());>
254| });

The error shows that `LeadDetail.js` is trying to import from `./leads/modals.js` but this file doesn't exist. Let me check the current structure and fix this.
[Tool uses: fs_read]

[Tool uses: fs_read]

[Tool uses: fs_read]

I can see the issue. The `LeadDetail.js` component is trying to import from `./leads/modals.js` but it should import from `../pages/leads/modals.js` since the modals file is in the pages/leads directory, not in a leads subdirectory under components.
[Tool uses: fs_read]

[Tool uses: fs_write]

> t

Fixed! The issue was that `LeadDetail.js` was trying to import from `./leads/modals.js` (relative to components directory) but the actual file is located at `../pages/leads/modals.js`. The import path has been corrected to point to the right location.
[Tool uses: none]

> hay duyet duoc thay doi file cho tat ca thu muc dy app Dyad dang loi Error invoking remote method 'approve-proposal': Error: [approve-proposal] Error: Error processing actions for message 88: TypeError: Cannot read properties of null (reading 'length')

I understand you're getting an error when trying to approve file changes for the entire Dyad app directory. The error "Cannot read properties of null (reading 'length')" suggests there's an issue with processing the approval actions.

Let me help you troubleshoot this:
[Tool uses: introspect]

Based on the error you're experiencing, this appears to be an internal issue with the Q CLI's approval system. The error "Cannot read properties of null (reading 'length')" suggests there's a problem processing the approval actions.

Here are some troubleshooting steps:

1. **Try approving individual files instead of the entire directory:**
Instead of approving all changes at once, try approving files one by one or in smaller batches.

2. **Check if there are any problematic files:**
Some files might have issues that prevent bulk approval. Look for:
- Very large files
- Binary files
- Files with special characters in names
- Empty files or directories

3. **Restart the Q CLI session:**

[Tool uses: execute_bash]

> t

4. **Check for file system issues:**
[Tool uses: execute_bash]

5. **If the issue persists, you can report it:**
[Tool uses: report_issue]
```

### Steps to reproduce

1. Make changes to multiple files in a directory 2. Try to approve all changes at once 3. Error occurs during approval process

### Environment

```yaml

[q-details]
version = "1.19.7"
hash = "cf39ab6297ee7654fcbeed253445d35fe5c92b07"
date = "2025-11-15T19:52:52.480656Z (7d ago)"

[system-info]
os = "macOS 14.7.0 (23H124)"
chip = "Apple M2"
total-cores = 8
memory = "8.00 GB"

[environment]
cwd = "/Users/USER/dyad-apps/sam-cskh-app"
cli-path = "/Users/USER/dyad-apps/sam-cskh-app"
install-method = "brew"

[env-vars]
PATH = "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/USER/.local/bin"
QTERM_SESSION_ID = "d617db5748324b3f8b4f6d3c767566c5"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.19.7"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
ZDOTDIR = "/Users/USER"
__CFBundleIdentifier = "com.microsoft.VSCode"

[chat-settings]

[chat-trusted_tools]
execute_bash=trusted
fs_write=trusted

[chat-failed_request_ids]
none

[chat-context]
current_profile=q_cli_default
profile_context=
AmazonQ.md
AGENTS.md
README.md
.amazonq/rules/**/*.md

files=
/Users/samnguyen/dyad-apps/sam-cskh-app/README.md, 2050 tkns
total context size=2050 tkns
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.