Skip to content

Commit

Permalink
Fix Prisma client references in build
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsilvestre committed Nov 24, 2024
1 parent d3b2ed0 commit 711ef93
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 34 deletions.
2 changes: 1 addition & 1 deletion app/db.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function getPrismaClient() {
url: databaseUrl.toString(),
},
},
});
}) as PrismaClient;
// connect eagerly
client.$connect();

Expand Down
2 changes: 1 addition & 1 deletion app/models/figure.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const FIGURES_VERSION = 3;
export const FIGURES_VERSION = 2;

export type FigureKey = string;

Expand Down
65 changes: 34 additions & 31 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.7",
"prisma": "^5.7.0",
"prisma": "^5.22.0",
"start-server-and-test": "^2.0.1",
"tailwindcss": "^3.4.15",
"vite": "^5.0.0",
Expand Down
8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
plugins: [reactRouter(), tsconfigPaths()],
resolve: {
// https://github.com/prisma/prisma/issues/12504#issuecomment-2094394268
alias: {
".prisma/client/index-browser":
"./node_modules/.prisma/client/index-browser.js",
".prisma/client/edge": "./node_modules/.prisma/client/edge.js",
},
},
});

0 comments on commit 711ef93

Please sign in to comment.