probot / smee-client

🔴 Receives payloads then sends them to your local server
https://smee.io
ISC License
439 stars 137 forks source link

TypeError: this.fetch is not a function #285

Closed themustafaomar closed 9 months ago

themustafaomar commented 9 months ago

Hi,

Firstly, thanks for working on this great service, really helpful.

I'm encountering an error when receiving a payload. It's throwing the following error.

image

Oddly, it worked fine on another machine yesterday, any ideas on what might be causing this?

wolfy1339 commented 9 months ago

What version of Node? What version of smee-client?

themustafaomar commented 9 months ago

Node v16.20.2 smee-client v2.0.0

wolfy1339 commented 9 months ago

Yeah, that would be the issue. You'll need to upgrade your Node version to at least v18.

I'm not sure why it isn't marked in the package.json though.

themustafaomar commented 9 months ago

Thank you for the fast response 🎉

ganker-vito commented 6 months ago

Yeah, that would be the issue. You'll need to upgrade your Node version to at least v18.

I'm not sure why it isn't marked in the package.json though.

i have the same problem, and resolve by update my node version from v16 to v18...

akrieger commented 5 months ago

I'm using node v20 and still hitting this. Trying to run probot on a raspi on ubuntu, smee-client ^2.0.1.

cdda@ubuntupi:~/trop$ ./run_trop.sh
yarn run v1.22.22
$ probot run ./lib/index.js
getEnvVar: Fetching env var 'SUPPORTED_BRANCH_PATTERN'
INFO (server): Running Probot v12.3.4 (Node.js: v20.13.1)
INFO (server): Forwarding https://smee.io/XeUQ6rLwFPpW4PXx to http://localhost:3000/
INFO (server): Listening on http://localhost:3000
INFO (server): Connected
ERROR (server): this.fetch is not a function
    TypeError: this.fetch is not a function
        at Client.onmessage (/home/cdda/trop/node_modules/smee-client/index.js:44:41)
        at EventSource.emit (node:events:519:28)
        at EventSource.emit (node:domain:488:12)
        at _emit (/home/cdda/trop/node_modules/eventsource/lib/eventsource.js:287:17)
        at parseEventStreamLine (/home/cdda/trop/node_modules/eventsource/lib/eventsource.js:302:9)
        at IncomingMessage.<anonymous> (/home/cdda/trop/node_modules/eventsource/lib/eventsource.js:259:11)
        at IncomingMessage.emit (node:events:519:28)
        at IncomingMessage.emit (node:domain:488:12)
        at addChunk (node:internal/streams/readable:559:12)
        at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)