admin管理员组文章数量:1307219
I am running NixOS on channel 24.11 (newest stable at the time of wiriting).
I have installed system wide packages prisma-engines
and prisma
but when I try to run either prisma studio or my code which interacts with the database i get:
Example error from prisma studio
Message: Error in Prisma Client request:
Cannot read properties of undefined (reading 'bind')
Query:
{
"modelName": "EmailRequest",
"operation": "findMany",
"args": {
"take": 100,
"skip": 0,
"select": {
"id": true,
"name": true,
"email": true,
"subject": true,
"content": true,
"createdAt": true,
"sentAt": true
}
}
}
My docker container is running and is working on Windows and MacOS.
I have ran prisma generate
and prisma migrate deploy
successfully.
my configuration.nix prisma part looks like this:
{ config, pkgs, ... }:
{
# ...
environment.systemPackages = with pkgs; [
# ...
prisma-engines
prisma
# ...
];
# ...
environment.sessionVariables = with pkgs; {
PRISMA_FMT_BINARY = "${prisma-engines}/bin/prisma-fmt";
PRISMA_QUERY_ENGINE_BINARY = "${prisma-engines}/bin/query-engine";
PRISMA_QUERY_ENGINE_LIBRARY = "${prisma-engines}/lib/libquery_engine.node";
PRISMA_SCHEMA_ENGINE_BINARY = "${prisma-engines}/bin/schema-engine";
PRISMA_INTROSPECTION_ENGINE_BINARY = "${prisma-engines}/bin/introspection-engine";
};
# ...
}
Checked on Widnows and MacOs - both work.
My docker container is running and is working on Windows and MacOS.
I have ran prisma generate
and prisma migrate deploy
successfully.
--- additional information ---
Output of npx prisma -v
:
➜ innovio git:(master) npx prisma -v
Environment variables loaded from .env
prisma : 6.1.0
@prisma/client : 6.1.0
Computed binaryTarget : linux-nixos
Operating System : linux
Architecture : x64
Node.js : v22.13.1
Query Engine (Node-API) : libquery-engine 0000000000000000000000000000000000000000 (at ../../../../nix/store/gy86fdkn00q51wcs88nrcsln5vq7wb9r-prisma-engines-5.22.0/lib/libquery_engine.node, resolved by PRISMA_QUERY_ENGINE_LIBRARY)
Schema Engine : schema-engine-cli 0000000000000000000000000000000000000000 (at ../../../../nix/store/gy86fdkn00q51wcs88nrcsln5vq7wb9r-prisma-engines-5.22.0/bin/schema-engine, resolved by PRISMA_SCHEMA_ENGINE_BINARY)
Schema Wasm : @prisma/prisma-schema-wasm 6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959
Default Engines Hash : 11f085a2012c0f4778414c8db2651556ee0ef959
Studio : 0.503.0
Preview Features : prismaSchemaFolder
I am running NixOS on channel 24.11 (newest stable at the time of wiriting).
I have installed system wide packages prisma-engines
and prisma
but when I try to run either prisma studio or my code which interacts with the database i get:
Example error from prisma studio
Message: Error in Prisma Client request:
Cannot read properties of undefined (reading 'bind')
Query:
{
"modelName": "EmailRequest",
"operation": "findMany",
"args": {
"take": 100,
"skip": 0,
"select": {
"id": true,
"name": true,
"email": true,
"subject": true,
"content": true,
"createdAt": true,
"sentAt": true
}
}
}
My docker container is running and is working on Windows and MacOS.
I have ran prisma generate
and prisma migrate deploy
successfully.
my configuration.nix prisma part looks like this:
{ config, pkgs, ... }:
{
# ...
environment.systemPackages = with pkgs; [
# ...
prisma-engines
prisma
# ...
];
# ...
environment.sessionVariables = with pkgs; {
PRISMA_FMT_BINARY = "${prisma-engines}/bin/prisma-fmt";
PRISMA_QUERY_ENGINE_BINARY = "${prisma-engines}/bin/query-engine";
PRISMA_QUERY_ENGINE_LIBRARY = "${prisma-engines}/lib/libquery_engine.node";
PRISMA_SCHEMA_ENGINE_BINARY = "${prisma-engines}/bin/schema-engine";
PRISMA_INTROSPECTION_ENGINE_BINARY = "${prisma-engines}/bin/introspection-engine";
};
# ...
}
Checked on Widnows and MacOs - both work.
My docker container is running and is working on Windows and MacOS.
I have ran prisma generate
and prisma migrate deploy
successfully.
--- additional information ---
Output of npx prisma -v
:
➜ innovio git:(master) npx prisma -v
Environment variables loaded from .env
prisma : 6.1.0
@prisma/client : 6.1.0
Computed binaryTarget : linux-nixos
Operating System : linux
Architecture : x64
Node.js : v22.13.1
Query Engine (Node-API) : libquery-engine 0000000000000000000000000000000000000000 (at ../../../../nix/store/gy86fdkn00q51wcs88nrcsln5vq7wb9r-prisma-engines-5.22.0/lib/libquery_engine.node, resolved by PRISMA_QUERY_ENGINE_LIBRARY)
Schema Engine : schema-engine-cli 0000000000000000000000000000000000000000 (at ../../../../nix/store/gy86fdkn00q51wcs88nrcsln5vq7wb9r-prisma-engines-5.22.0/bin/schema-engine, resolved by PRISMA_SCHEMA_ENGINE_BINARY)
Schema Wasm : @prisma/prisma-schema-wasm 6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959
Default Engines Hash : 11f085a2012c0f4778414c8db2651556ee0ef959
Studio : 0.503.0
Preview Features : prismaSchemaFolder
Share
Improve this question
edited Feb 3 at 16:37
Mollybdenum
asked Feb 3 at 11:15
MollybdenumMollybdenum
32 bronze badges
2
|
1 Answer
Reset to default 0I have figured it out.
On the current stable channel the prisma-engines
is in version 5.22. My @prisma/client
was in version 6.1.0. This mismatch causes issues with prisma client. Downgrading to 5.22, removing package-lock.json and node_modules and installing everything again (inside the developement repository) worked.
For anyone curious, at the time of wiritng, latest unstable prisma-engines is in version 6.0.1.
本文标签: nixPrisma Client errors on NixOS channell 2411Stack Overflow
版权声明:本文标题:nix - Prisma Client errors on NixOS channell 24.11 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741826080a2399649.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
systemPackages
. Having a per-projectshell.nix
orflake.nix
or so forth specifying those versions as part of your software toolchain (activated withnix develop
ornix-shell
or so forth) means every developer can be on the exact same version, you can apply patches and have them apply to everyone on your team, etc. – Charles Duffy Commented Feb 3 at 16:42