BuilderIO / ai-shell

A CLI that converts natural language to shell commands.
MIT License
4.04k stars 257 forks source link

"payload.replaceAll is not a function" #31

Closed aetherwu closed 1 year ago

aetherwu commented 1 year ago

ai check ip address

┌  AI Shell
│
◇  Your script:

(node:72142) UnhandledPromiseRejectionWarning: TypeError: payload.replaceAll is not a function
    at parseContent (file:///usr/local/lib/node_modules/@builder.io/ai-shell/dist/cli.mjs:296:27)
    at file:///usr/local/lib/node_modules/@builder.io/ai-shell/dist/cli.mjs:281:19
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:72142) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

(node:72142) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is there any information I should provide?

soumilroy commented 1 year ago

Please check #28

steve8708 commented 1 year ago

went ahead and added a polyfill for this so others don't run into it. I realized that it's only a certain minor version of node 14 that supports this but the docs just say you need regular v14 so I've updated the code accordingly

released a fix in 0.1.7