qode
qode
PPrisma
Created by qode on 4/10/2025 in #help-and-questions
panicked at query-engine\query-engine-node-api\src\engine. Failed to deserialize constructor options
And then removing the postinstall and bundling in package.json, replacing it with prepare script.
{
"name": "@orgname/prisma-client-package",
"version": "1.3.6",
"description": "Shared Prisma Client as Internal Package",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"author": "Orgname <[email protected]>",
"scripts": {
"build": "tsc",
"prisma:migrate": "npx prisma migrate dev --name init",
"prisma:introspect": "npx prisma introspect",
"prisma:generate": "npx prisma generate",
"prisma:push": "npx prisma db push",
"start": "npx prisma studio",
"prepare": "npx prisma generate && tsc && cp src/index.d.ts dist/index.d.ts",
"postinstall": "echo 'postinstall complete.'",
"test": "echo \"Error: no test specified\" && exit 0"
},
"repository": {
"type": "git",
"url": "https://github.com/orgname/prisma-client-package.git"
},
"license": "MIT",
"dependencies": {
"@prisma/client": "5.16.1",
"dotenv": "^16.4.5"
},
"devDependencies": {
"@types/node": "^20.11.17",
"prisma": "5.16.1",
"typescript": "5.0.4"
},
"bundledDependencies": [],
"files": [
"dist",
"scripts",
"schema.prisma",
"prisma/generated/client"
],
"publishConfig": {
"access": "restricted",
"registry": "https://npm.pkg.github.com"
}
}
{
"name": "@orgname/prisma-client-package",
"version": "1.3.6",
"description": "Shared Prisma Client as Internal Package",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"author": "Orgname <[email protected]>",
"scripts": {
"build": "tsc",
"prisma:migrate": "npx prisma migrate dev --name init",
"prisma:introspect": "npx prisma introspect",
"prisma:generate": "npx prisma generate",
"prisma:push": "npx prisma db push",
"start": "npx prisma studio",
"prepare": "npx prisma generate && tsc && cp src/index.d.ts dist/index.d.ts",
"postinstall": "echo 'postinstall complete.'",
"test": "echo \"Error: no test specified\" && exit 0"
},
"repository": {
"type": "git",
"url": "https://github.com/orgname/prisma-client-package.git"
},
"license": "MIT",
"dependencies": {
"@prisma/client": "5.16.1",
"dotenv": "^16.4.5"
},
"devDependencies": {
"@types/node": "^20.11.17",
"prisma": "5.16.1",
"typescript": "5.0.4"
},
"bundledDependencies": [],
"files": [
"dist",
"scripts",
"schema.prisma",
"prisma/generated/client"
],
"publishConfig": {
"access": "restricted",
"registry": "https://npm.pkg.github.com"
}
}
8 replies
PPrisma
Created by qode on 4/10/2025 in #help-and-questions
panicked at query-engine\query-engine-node-api\src\engine. Failed to deserialize constructor options
Fixed: the issue was that when other projects use my prisma package. they install the latest version of @prisma/client as dep which is incompatible with the package version. there are many fixes. but i went for setting up custom output for the prisma client in the package at ./prisma/generated/client. Then i edit shema.prisma to:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x", "linux-musl"]
output = "./prisma/generated/client"
}
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x", "linux-musl"]
output = "./prisma/generated/client"
}
8 replies