Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

josn.map is not a function with the CLI #59

Open
kqvanity opened this issue Oct 4, 2024 · 1 comment
Open

josn.map is not a function with the CLI #59

kqvanity opened this issue Oct 4, 2024 · 1 comment

Comments

@kqvanity
Copy link

kqvanity commented Oct 4, 2024

running claude --key raises the following error

(node:2610641) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
TypeError: json.map is not a function
    at Claude.getConversations (file:///home/keinvanity/.local/lib/node_modules/claude-cli/node_modules/claude-ai/index.js:298:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Claude.init (file:///home/keinvanity/.local/lib/node_modules/claude-cli/node_modules/claud
e-ai/index.js:174:37)
    at async main (file:///home/keinvanity/.local/lib/node_modules/claude-cli/index.js:124:5)

and running via the library raises another error

file:///home/keinvanity/Downloads/claude-misc/Explosion-Scratch-claude-unofficial-api/node_modules/claude-ai/index.js:171
            throw new Error(JSON.stringify(organizations, null, 2))
                  ^

Error: {
  "error": {
    "message": "We are unable to serve your request",
    "type": "permission_error"
  }
}
    at Claude.init (file:///home/keinvanity/Downloads/claude-misc/Explosion-Scratch-claude-unofficial-api/node_modules/claude-ai/index.js:171:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///home/keinvanity/Downloads/claude-misc/Explosion-Scratch-claude-unofficial-api/main.js:7:1

Node.js v22.9.0
@johnd0e
Copy link

johnd0e commented Dec 17, 2024

TypeError: json.map is not a function

This particular problem can be fixed adding user-agent to the headers everywhere.
After it I can login and e.g. export my existing conversations.
But still it fails on creating new conversation with 403 error ("We are unable to serve your request").

I have no idea why. Because I can do the same with barebone curl without any problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants