Prisma Sveltekit Generated Client -> exports is not defined

127 views Asked by At

i have two schema files in my sveltekit project (sqlServer, MongoDb) and i generated two clients with those schemas.

I setup this minimal reproduction here: https://github.com/TheBigMemph/test

If i load either one of the clients declared in lib/index.ts into the app the following error comes up:

12:22:05 [vite] Error when evaluating SSR module /prisma/generated/sql/index-browser.js:
|- ReferenceError: exports is not defined
    at /Users/***/***/test/my-app/prisma/generated/sql/index-browser.js:2:23
    at instantiateModule (file:///Users/***/***/test/my-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:15)

12:22:05 [vite] Error when evaluating SSR module /src/lib/index.ts: failed to import "/prisma/generated/sql/index-browser.js"
|- ReferenceError: exports is not defined
    at /Users/***/***/test/my-app/prisma/generated/sql/index-browser.js:2:23
    at instantiateModule (file:///Users/***/***/test/my-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:15)

12:22:05 [vite] Error when evaluating SSR module /src/routes/+page.ts: failed to import "/src/lib/index.ts"
|- ReferenceError: exports is not defined
    at /Users/***/***/test/my-app/prisma/generated/sql/index-browser.js:2:23
    at instantiateModule (file:///Users/***/***/test/my-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:15)

ReferenceError: exports is not defined
    at /Users/***/***/test/my-app/prisma/generated/sql/index-browser.js:2:23
    at instantiateModule (file:///Users/***/***/test/my-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:15)
ReferenceError: exports is not defined
    at /Users/***/***/test/my-app/prisma/generated/sql/index-browser.js:2:23
    at instantiateModule (file:///Users/***/***/test/my-app/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:15)

If i'm using just one schema file without a custom output it's working.

Thanks in advance!

0

There are 0 answers