Artem
02/08/2022, 3:36 PM@prisma/client
, which attempts to read the config2.datamodelPath
at LibraryEngine
. Sharing more details below šArtem
02/08/2022, 3:37 PMapps/
web/
app/
routes/
graphql.ts (imports "server", creates a GraphQL server baseds on the exported schema.
packages/
clients/ (pulls the db, generates client)
prisma.ts // imports "@prisma/client"
server/
index.ts // exports a GraphQL schema.
// one of its data sources uses prisma from "clients"
Artem
02/08/2022, 3:38 PMclients
and server
respectively.
Here's the exception that happens on runtime when I hit my /
edge function on Vercel:
2022-02-08T15:29:19.468Z undefined ERROR Error: ENOENT: no such file or directory, open '/var/task/output/server/pages/api/schema.prisma'
at Object.openSync (fs.js:497:3) at Object.readFileSync (fs.js:393:35)
at new LibraryEngine (/var/task/output/server/pages/api/index.js:191039:40)
at PrismaClient.getEngine (/var/task/output/server/pages/api/index.js:195362:16)
at new PrismaClient (/var/task/output/server/pages/api/index.js:195333:29)
at Object.<anonymous> (/var/task/output/server/pages/api/index.js:196256:19)
at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
Artem
02/08/2022, 3:39 PMfs
operations are not supported by edge functions in Vercel (see https://vercel.com/docs/concepts/functions/edge-functions#runtime).Artem
02/08/2022, 3:40 PMapi/index.js
route that serves the entire app in Remix. The built route includes the source of prisma/client, which contains this line:
var LibraryEngine = /* @__PURE__ */ __name(class extends Engine {
constructor(config2) {
super();
var _a2, _b2;
this.datamodel = import_fs.default.readFileSync(config2.datamodelPath, "utf-8");
Reading that datamodel is what throws a runtime exception in my edge function (because it relies on a fs
operation).Artem
02/08/2022, 3:41 PMArtem
02/08/2022, 3:44 PMArtem
02/08/2022, 3:50 PMclients
) and is used in another repo through a dependency (web -> server
).
I really don't want to generate prisma client in the web
repo, as everything should be prepared in the clients
.Artem
02/08/2022, 3:51 PMprisma@3.9.1
Artem
02/08/2022, 3:52 PMRichard
03/12/2022, 4:54 PMArtem
03/12/2022, 6:07 PMRichard
03/14/2022, 7:33 PM