Skip to content

Commit

Permalink
πŸ”§ Fix prisma query engine import error (#16)
Browse files Browse the repository at this point in the history
* πŸ”§ `prisma` Modify generated path

* πŸ”§ `prisma` Fix export paths

* πŸ”§ `prisma` Fix prisma config files

* πŸ”§ `prisma` Added resolver package in `worxpace` app
  • Loading branch information
steeeee0223 authored Feb 18, 2024
1 parent 69ea536 commit 4113c8f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 10 deletions.
15 changes: 13 additions & 2 deletions apps/worxpace/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { PrismaPlugin } from "@prisma/nextjs-monorepo-workaround-plugin";

// Importing env files here to validate on build
import "./src/env.js";

Expand All @@ -15,7 +17,7 @@ const config = {
/** We already do linting and typechecking as separate tasks in CI */
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true },

/** */
images: {
remotePatterns: [
{
Expand All @@ -31,7 +33,16 @@ const config = {
hostname: "files.edgestore.dev",
},
]
}
},
webpack: (config, { isServer }) => {
if (isServer) {
/** To Fix Prisma */
/** See https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/nextjs-prisma-client-monorepo */
config.plugins = [...config.plugins, new PrismaPlugin()]
}

return config
},
};

export default config;
1 change: 1 addition & 0 deletions apps/worxpace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tailwind-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@prisma/nextjs-monorepo-workaround-plugin": "^5.9.1",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
Expand Down
5 changes: 3 additions & 2 deletions packages/prisma/prisma/auth.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
output = "../.generated/auth"
provider = "prisma-client-js"
output = "../node_modules/.prisma/client/auth"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}

datasource db {
Expand Down
5 changes: 3 additions & 2 deletions packages/prisma/prisma/worxpace.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
output = "../.generated/worxpace"
provider = "prisma-client-js"
output = "../node_modules/.prisma/client/worxpace"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}

datasource db {
Expand Down
8 changes: 4 additions & 4 deletions packages/prisma/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-var */
import { PrismaClient as Auth } from "../.generated/auth";
import { PrismaClient as Worxpace } from "../.generated/worxpace";
import { PrismaClient as Auth } from ".prisma/client/auth";
import { PrismaClient as Worxpace } from ".prisma/client/worxpace";

declare global {
var authClient: Auth | undefined;
Expand Down Expand Up @@ -29,5 +29,5 @@ export type {
List,
Subscription,
User,
} from "../.generated/worxpace";
export { ROLE, ACTION, ENTITY_TYPE } from "../.generated/worxpace";
} from ".prisma/client/worxpace";
export { ROLE, ACTION, ENTITY_TYPE } from ".prisma/client/worxpace";
7 changes: 7 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 4113c8f

Please sign in to comment.