Skip to content

Commit

Permalink
fix: 🐛 Prisma client not working on production
Browse files Browse the repository at this point in the history
After build success, prisma client error at runtime, Prisma Client could
not locate the Query Engine for runtime "debian-openssl-3.0.x".

✅ Closes: #173
  • Loading branch information
growupanand committed Feb 1, 2024
1 parent ef2dd15 commit 59fb06a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
8 changes: 8 additions & 0 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import createMDX from "@next/mdx";
import { PrismaPlugin } from "@prisma/nextjs-monorepo-workaround-plugin";
// Injected content via Sentry wizard below

import { withSentryConfig } from "@sentry/nextjs";
Expand Down Expand Up @@ -26,6 +27,13 @@ const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
transpilePackages: ["@convoform/ui", "@convoform/db"],
webpack: (config, { isServer }) => {
if (isServer) {
config.plugins = [...config.plugins, new PrismaPlugin()];
}

return config;
},
};

const withMDX = createMDX({
Expand Down
9 changes: 5 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@
"react-dom": "^18",
"react-hook-form": "^7.48.2",
"remark-gfm": "^4.0.0",
"superjson": "^2.2.1",
"tailwind-merge": "^2.0.0",
"zod": "^3.22.4",
"superjson": "^2.2.1"
"zod": "^3.22.4"
},
"devDependencies": {
"@convoform/eslint-config": "workspace:*",
"@convoform/tsconfig": "workspace:*",
"@prisma/nextjs-monorepo-workaround-plugin": "^5.9.0",
"@swc-jotai/react-refresh": "^0.1.0",
"@tanstack/react-query-devtools": "^5.17.21",
"@types/node": "^20",
"@types/nprogress": "^0.2.3",
"@types/react": "^18",
Expand All @@ -62,7 +64,6 @@
"eslint-plugin-unused-imports": "^3.0.0",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5",
"@tanstack/react-query-devtools": "^5.17.21"
"typescript": "^5"
}
}
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 59fb06a

Please sign in to comment.