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

TypeError: callback is not a function #216

Closed
joshxyzhimself opened this issue Aug 22, 2021 · 4 comments
Closed

TypeError: callback is not a function #216

joshxyzhimself opened this issue Aug 22, 2021 · 4 comments

Comments

@joshxyzhimself
Copy link

env

postgres 2.0.0-beta.7
Ubuntu 20.04.2 LTS
node v16.4.0
npm 7.18.1

context

happens when i start running my server script, node ./server/index.js.

my server script executes select queries as soon as the next tick.

unsure how to try-catch this since its an error within an onready event handler.

error

/project/node_modules/postgres/lib/connection.js:419
      callback && callback()
                  ^

TypeError: callback is not a function
    at write (/project/node_modules/postgres/lib/connection.js:419:19)
    at Array.forEach (<anonymous>)
    at onready (/project/node_modules/postgres/lib/connection.js:243:16)
    at Object.ReadyForQuery (/project/node_modules/postgres/lib/backend.js:238:5)
    at Socket.data (/project/node_modules/postgres/lib/connection.js:297:25)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:312:12)
    at readableAddChunk (node:internal/streams/readable:287:9)
    at Socket.Readable.push (node:internal/streams/readable:226:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
@joshxyzhimself
Copy link
Author

hi, i rolled-back to 2.0.0-beta.6, seems like the error is gone.

will update here if i encounter it again.

@porsager
Copy link
Owner

Ah, nice report @joshxyzhimself , I'll take a look..

@porsager
Copy link
Owner

Got it - thanks a lot. It'll be included with the next release

@joshxyzhimself
Copy link
Author

thank you @porsager!! 🙏 🙏 💯

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