小编Lou*_*ist的帖子

使用 Prisma Dockerize NextJS 应用程序

我创建了一个 NextJS 应用程序,用于连接到我使用 Prisma 的数据库。当我在计算机上启动该应用程序时,一切正常。不幸的是,当我尝试在 Docker 容器中运行应用程序时收到错误消息。可以创建并启动容器。还可以显示应用程序的起始页(那里还没有数据库查询)。但是,当我单击有数据库查询的第一页时,我在控制台中收到错误代码 500 - 初始服务器错误和以下错误消息:

PrismaClientInitializationError: Unknown PRISMA_QUERY_ENGINE_LIBRARY undefined. Possible binaryTargets: darwin, darwin-arm64, debian-openssl-1.0.x, debian-openssl-1.1.x, rhel-openssl-1.0.x, rhel-openssl-1.1.x, linux-arm64-openssl-1.1.x, linux-arm64-openssl-1.0.x, linux-arm-openssl-1.1.x, linux-arm-openssl-1.0.x, linux-musl, linux-nixos, windows, freebsd11, freebsd12, openbsd, netbsd, arm, native or a path to the query engine library.
You may have to run prisma generate for your changes to take effect.
    at cb (/usr/src/node_modules/@prisma/client/runtime/index.js:38689:17)
    at async getServerSideProps (/usr/src/.next/server/pages/admin/admin.js:199:20)
    at async Object.renderToHTML (/usr/src/node_modules/next/dist/server/render.js:428:24)
    at async doRender (/usr/src/node_modules/next/dist/server/next-server.js:1144:38)
    at async /usr/src/node_modules/next/dist/server/next-server.js:1236:28
    at async /usr/src/node_modules/next/dist/server/response-cache.js:64:36 {
  clientVersion: '3.6.0', …
Run Code Online (Sandbox Code Playgroud)

docker next.js prisma

4
推荐指数
1
解决办法
7669
查看次数

标签 统计

docker ×1

next.js ×1

prisma ×1