Hello team, I’m using Prisma@2.26 at the moment an...
# orm-help
e
Hello team, I’m using Prisma@2.26 at the moment and I’m trying to set an environment variable for
client.binaryTargets
. It looks like there’s this issue which has been addressed in this PR. However, I’m still having problems, and may be someone can help clarify how I’m supposed to use it. Here’s the related part in my schema:
Copy code
generator client {
  provider      = "prisma-client-js"
  binaryTargets = env("PRISMA_BINARY_TARGET") // I also tried to use `[env("PRISMA_BINARY_TARGET")]` but getting the same errors regardless
}
I have
JSON.parse
error when I try to do this:
PRISMA_BINARY_TARGET=native prisma generate
. Note that this was working in version 2.22 I think it’s because the parse function expects the env to be a JSON string 🤔 Anyways, running the following command works:
PRISMA_BINARY_TARGET='[\"native\"]' prisma generate
. To me, this is less ideal than the previous version because I didn’t know what to use until I looked at the source code. 😅 ( Maybe there are some documentation I’m missing ) Is this a bug? Happy to create an issue to follow up 🙂
j
If something worked before and does not any more now, it is a bug indeed and you can open an issue.
Although try setting your env var to an actual JS array as a string maybe? binary targets does expect
["native", "windows"]
or similar usually.