Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error thrown on debug statement #6135

@iainsproat

Description

@iainsproat

Environment

Knex version:
Database + version:
OS:

Select applicable template from below.
If issue is about oracledb support, tag @ atiertant. For MSSql tag @ smorey2.
Rest of dialects don't need tags.
If issue is about TypeScript definitions, tag @ lorefnon.

Bug

/server/node_modules/knex/lib/client.js:324
    debug('releasing connection to pool: %s', connection.__knexUid);
                                                         ^

TypeError: Cannot read properties of undefined (reading '__knexUid')
    at Client_PG.releaseConnection (/server/node_modules/knex/lib/client.js:324:58)
    at Transform.<anonymous> (/server/node_modules/knex/lib/execution/runner.js:72:19)
    at Transform.emit (node:events:529:35)
    at emitCloseNT (node:internal/streams/destroy:132:10)
    at emitErrorCloseNT (node:internal/streams/destroy:117:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Feature discussion / request

the code should handle the case of undefined or null connection passed to releaseConnection:

debug('releasing connection to pool: %s', connection.__knexUid);

Missing / erroneus documentation

  1. What is the missing or erroneus part of the documentation

  2. What is the correct information

  3. If you have time, you can also make a pull request to fix the documentation

Questions about how to use knex

GitHub issues are for knex development. Please send questions how to use knex to
Stack Overflow or ask about it in gitter chat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions