Closed xlc closed 1 month ago
you have a timeout there, the "Attempting to change value of a readonly property" seems like a complimentary thing on the stack trace
I know. But a timeout shouldn’t causing TypeError.
Yep, same problem. It's in the library.
TypeError: Attempting to change value of a readonly property.
at queryError (/app/node_modules/postgres/src/connection.js:388:5)
at errored (/app/node_modules/postgres/src/connection.js:384:17)
at data (/app/node_modules/postgres/src/connection.js:318:9)
at addChunk (node:stream:1940:43)
at readableAddChunk (node:stream:1894:59)
at data (node:net:52:17)
27 | return error
28 | }
29 |
30 | function postgres(x) {
31 | const error = new PostgresError(x)
32 | Error.captureStackTrace(error, postgres)
^
PostgresError: query_wait_timeout
code: "08P01"
Your problem is here:
function queryError(query, err) {
/// `err` is undefined here for some reason.
/// Should handle null/undefined case so that the error handler *itself* doesn't throw an undefined error.
/// Line 388:
Object.defineProperties(err, {
stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
query: { value: query.string, enumerable: options.debug },
parameters: { value: query.parameters, enumerable: options.debug },
args: { value: query.args, enumerable: options.debug },
types: { value: query.statement && query.statement.types, enumerable: options.debug }
})
query.reject(err)
}
It works in node, so you should file an issue in bun about not being able to override properties on an Error instance.
Getting those error
Using version 3.4.3 and bun v1.0.13
The write timeout could be my app doing something wrong but I don't expect TypeError