Prisma broken for next when generating prisma client in non-node_modules dirs
See original GitHub issueMy bad 😦
Broke by my PR here: https://github.com/t3-oss/create-t3-turbo/pull/37
Error here, unable to find schema:
https://twitter.com/t3dotgg/status/1582936894991609857
Tried solution here: https://github.com/prisma/prisma/issues/10433#issuecomment-1264687986
Gets further, but new error:
@acme/nextjs:dev: prisma:query SELECT `main`.`Post`.`id`, `main`.`Post`.`title`, `main`.`Post`.`content` FROM `main`.`Post` WHERE 1=1 LIMIT ? OFFSET ?
@acme/nextjs:dev: prisma:query SELECT 1
@acme/nextjs:dev: prisma:query SELECT name FROM sqlite_schema
@acme/nextjs:dev: WHERE type='table'
@acme/nextjs:dev: ORDER BY name;
@acme/nextjs:dev:
@acme/nextjs:dev: failed to fetch, PrismaClientKnownRequestError:
@acme/nextjs:dev: Invalid `prisma.post.findMany()` invocation:
@acme/nextjs:dev:
@acme/nextjs:dev:
@acme/nextjs:dev: The table `main.Post` does not exist in the current database.
@acme/nextjs:dev: at RequestHandler.handleRequestError (webpack-internal:///(api)/../../packages/db/.generated/client/runtime/index.js:31874:19)
@acme/nextjs:dev: at RequestHandler.request (webpack-internal:///(api)/../../packages/db/.generated/client/runtime/index.js:31853:18)
@acme/nextjs:dev: at async PrismaClient._request (webpack-internal:///(api)/../../packages/db/.generated/client/runtime/index.js:32853:24)
@acme/nextjs:dev: at async eval (webpack-internal:///(api)/../../packages/api/src/router/post.ts:19:26)
@acme/nextjs:dev: at async resolveMiddleware (file:///Users/theobrowne/Code/contrib/npm-turbo-t3/node_modules/@trpc/server/dist/router-28a2c129.mjs:190:30)
@acme/nextjs:dev: at async callRecursive (file:///Users/theobrowne/Code/contrib/npm-turbo-t3/node_modules/@trpc/server/dist/router-28a2c129.mjs:226:32)
@acme/nextjs:dev: at async resolve (file:///Users/theobrowne/Code/contrib/npm-turbo-t3/node_modules/@trpc/server/dist/router-28a2c129.mjs:254:24)
@acme/nextjs:dev: at async file:///Users/theobrowne/Code/contrib/npm-turbo-t3/node_modules/@trpc/server/dist/resolveHTTPResponse-f2b378b6.mjs:374:32
@acme/nextjs:dev: at async Promise.all (index 0)
@acme/nextjs:dev: at async resolveHTTPResponse (file:///Users/theobrowne/Code/contrib/npm-turbo-t3/node_modules/@trpc/server/dist/resolveHTTPResponse-f2b378b6.mjs:371:28) {
@acme/nextjs:dev: code: 'P2021',
@acme/nextjs:dev: clientVersion: '4.5.0',
@acme/nextjs:dev: meta: { table: 'main.Post' }
@acme/nextjs:dev: }
assumption is that it can’t actually find the db in next, which is weird because it can totally find it in prisma studio? idk.
Issue Analytics
- State:
- Created a year ago
- Comments:24 (10 by maintainers)
Top Results From Across the Web
Prisma CLI installation hangs indefinitely inside of docker ...
So to confirm there is no log, and it hangs at prisma generate executed during postinstall? (Tested with @prisma/cli 2.15.0?) A workaround /...
Read more >NestJS Prisma client unable to import generated types
However the issue now is that I have an error prompting that FulfilmentReportCreateInput is not an exported member when I can see it's...
Read more >Production database is not building - RedwoodJS Community
Hello people, I'm working on my deployment on netlify, so far I had to fix a couple of issues ( prod vars &...
Read more >Building Dad Jokes using The Prisma Framework (formerly ...
The newest version of Prisma does not require any such thing. ... const joke4 = await photon.jokes.create({ data: { joke: "Dad died because ......
Read more >please make sure your database server is running at ...
The command '/bin/sh -c npx prisma db push' returned a non-zero code: 1 ... file with all config. the main resan why postgres...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Using the changes from @subaanqasim got things running for me (very appreciated) locally.
When I run the deploy, I see this:
However, the API calls return:
Seems like either the db package is looking in the wrong place, or the generation output is going maybe two levels up from the root and out of the project?
Anyone hit on anything like this?
oh yeah lol, I got a ENOENT no such file error on the trpc API file pointing towards the prisma schema.