I updated to nano v11 and started getting server crashes in my local dev environment, because of this line:
|
response.statusText = response.cause.toString() |
Looks like the response doesn't have a cause property:
126 | const responseHeaders = Object.assign({
127 | uri: scrubURL(req.url),
128 | statusCode
129 | }, response.headers ? response.headers : {})
130 | if (!response.status) {
131 | response.statusText = response.cause.toString()
^
TypeError: undefined is not an object (evaluating 'response.cause.toString')
at <anonymous> (/opt/src/node_modules/nano/lib/nano.js:131:38)
at responseHandler (/opt/src/node_modules/nano/lib/nano.js:112:43)
at <anonymous> (/opt/src/node_modules/nano/lib/nano.js:431:11)
For reference I'm using Bun instead of Node.js, so that might be the real culprit, but the fix is either response.cause?.toString() or adding a fallback cause.
I updated to nano v11 and started getting server crashes in my local dev environment, because of this line:
couchdb-nano/lib/nano.js
Line 131 in 26fb0e1
Looks like the response doesn't have a
causeproperty:For reference I'm using Bun instead of Node.js, so that might be the real culprit, but the fix is either
response.cause?.toString()or adding a fallback cause.