Prisma-client-js: Client, Engine version incorrect when overriding binary with Prisma client constructor

Created on 18 May 2020  路  3Comments  路  Source: prisma/prisma-client-js

Bug description

With export DEBUG=*, Prisma client logs Engine, Client version.

These versions are correct

  1. For the default binary
  2. When a binary is replace with QUERY_ENGINE_BINARY_PATH env var

These versions are incorrect (incorrectly pointing to the default binary)

  1. When binary is overridden with Prisma client's constructor
const prisma = new PrismaClient({
  __internal: {
    engine: {
      cwd: process.cwd(),
      binaryPath: path.join(process.cwd(), './binaries/query-engine'),
    },
  },
})

How to reproduce

Steps to reproduce the behavior:

  1. Compile a custom binary and use Prisma client constructor to override it.
  2. Use DEBUG=*
  3. Run the client and execute a query against it.

Expected behavior

The logged version should be of the binary being used.

bu2-confirmed kinbug tectypescript

All 3 comments

So it appears that the engineVersion from the DEBUG output comes from the code generated client
Screen Shot 2020-05-18 at 16 30 37
(The client version in this screenshot is wrong and was already fixed)

The issue here is that the hash in the debug log is hardcoded so when the binary is different like when using an env var or with the constructor in the client it still outputs the hardcoded version.

Thanks a lot for reporting 馃檹
This issue is fixed in the latest dev version of @prisma/cli.
You can try it out with npm i -g @prisma/cli@dev.

In case it鈥檚 not fixed for you - please let us know and we鈥檒l reopen this issue!

Was this page helpful?
0 / 5 - 0 ratings