bunJS server + prisma server [UPDATE: fixed using "binary" engineType]

remusris
HOBBY

3 months ago

My server crashes right after deploying, I don't know how to solve this issue.

I'm not sure how I can add this depedency to the server since I don't have a dockerfile. I just used one of the bun templates and I wasn't expecting this not to work.

16 | ;throw new Error(u)}else if(r==="warn"){let u=Conflict for env var${s.length>1?"s":""} ${s.map(c=>Y(c)).join(", ")} in ${ee(a)} and ${ee(l)}

Mar 12 12:10:28

17 | Env vars from ${ee(l)} overwrite the ones from ${ee(a)}

Mar 12 12:10:28

18 | ;console.warn(${De("warn(prisma)")} ${u}`)}}}}function Es(e){if(_c(e)){Si(`Environment variables loaded from ${e}`);let t=Ai.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:ys(t),message:_e(`Environment variables loaded from ${yt.default.relative(process.cwd(),e)}`),path:e}}else Si(`Environment variables not found at ${e}`);return null}function bs(e,t){return e&&t&&yt.default.resolve(e)===yt.default.resolve(t)}function c(e){return!!(e&&Zr.default.existsSync(e))}var ws="library";function Et(e){let t=Dc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":ws)}function Dc(){let e=process.env.PRISMACLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}var Cs="prisma+postgres",Xr=`${Cs}:`;function Ii(e){return e?.startsWith(`${Xr}//`)??!1}var tr;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.fi

Mar 12 12:10:28

19 | ${(0,Ss.default)(Fc(n),2)}

Mar 12 12:10:28

20 | }`}};function Lc(e){let t;if(e.length>0){let r=e.find(n=>n.fromEnvVar!==null);r?t=`env("${r.fromEnvVar}")`:t=e.map(n=>n.native?"native":n.value)}else t=void 0;return t}function Fc(e){let t=Object.keys(e).reduce((r,n)=>Math.max(r,n.length),0);return Object.entries(e).map(([r,n])=>`${r.padEnd(t)} = ${Mc(n)}`).join(`

Mar 12 12:10:28

21 | )}function Mc(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var ir={};Wt(ir,{error:()=>Vc,info:()=>qc,log:()=>$c,query:()=>jc,should:()=>As,tags:()=>nr,warn:()=>Ni});var nr={error:fe("prisma:error"),warn:De("prisma:warn"),info:Ne("prisma:info"),query:it("prisma:query")},As={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function $c(...e){console.log(...e)}function Ni(e,...t){As.warn()&&console.warn(`${nr.warn} ${e}`,...t)}function qc(e,...t){console.info(`${nr.info} ${e}`,...t)}function Vc(e,...t){console.error(`${nr.error} ${e}`,...t)}function jc(e,...t){console.log(`${nr.query} ${e}`,...t)}function en(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function Me(e,t){throw new Error(t)}function Fi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Mi=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});function bt(e,t){let r={};for

Mar 12 12:10:28

Mar 12 12:10:28

PrismaClientInitializationError: Unable to require(`/app/node_modules/.prisma/client/libquery_engine-debian-openssl-3.0.x.so.node`).

Mar 12 12:10:28

Prisma cannot find the required libssl system library in your system. Please install openssl-3.0.x and try again.

Mar 12 12:10:28

Mar 12 12:10:28

Details: libssl.so.3: cannot open shared object file: No such file or directory

Mar 12 12:10:28

clientVersion: "6.5.0",

Mar 12 12:10:28

errorCode: undefined,

Mar 12 12:10:28

retryable: undefined,

Mar 12 12:10:28

Mar 12 12:10:28

at new PrismaClientInitializationError (/app/node_modules/@prisma/client/runtime/library.js:21:1370)

Mar 12 12:10:28

at <anonymous> (/app/node_modules/@prisma/client/runtime/library.js:111:9544)

Mar 12 12:10:28

Mar 12 12:10:28

Bun v1.1.43 (Linux x64)

Mar 12 12:10:28

error: script "start" exited with code 1

Solved

1 Replies

remusris
HOBBY

3 months ago

I found a solution but its more of a workaround than a solution

in the

generator client

inside the schema.prisma file

I changed the engineType to binary

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["relationJoins"]
  engineType = "binary"
}

And this seems to have fixed that issue


Status changed to Solved brody 3 months ago