Skip to content

npx -p -- Execution failed: Cannot destructure property 'viewer' of 'r.data' as it is undefined. #188

@efjacobson

Description

@efjacobson

Describe the bug

my github copilot cli was in a broken state after attempting to use some apparently invalid syntax. i had been using it successfully by running npx @github/copilot and then manually copy/pasting prompts. i then wanted to pass the prompt in with the command, so i attempted npx @github/copilot -- -p 'asdf' and then npx @github/copilot -p 'asdf'. after the second command, i got this error: Execution failed: Cannot destructure property 'viewer' of 'r.data' as it is undefined.

i then attempted to go back to manually pasting prompts, but no matter what i pasted in, i got the same error. i tried clearing the session, deleting all contents of the directory, closing all terminal windows, even restarting the computer, but i still got the error

the slash commands like /help and /model still executed successfully, but all prompts, no matter how simple, failed in the same way

i was able to fix the issue by clearing out the npx cache: rm -rf ~/.npm/_npx

Affected version

Version 0.0.333 · Commit 4cbf3da

Steps to reproduce the behavior

  1. type npx @github/copilot -p 'asdf'

Expected behavior

fail gracefully

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions