question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate live reload of Prisma Client with `next dev`

See original GitHub issue

If I have a Next.js project running with Prisma Client and have a change in the schema.prisma file, then generated a new Client with prisma generate, it would be great, if I don’t have to restart the next dev process.

Probably clearing the require cache with some code like this would be necessary:

delete require.cache[require.resolve(clientDir)]
delete require.cache[clientDir]

As of now I need to restart the next dev process by hand, which is a bit cumbersome.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:40
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
harmandeep-singhcommented, Aug 1, 2021

@harmandeep-singh Were you ever able to resolve this?

Hi. @forrestwilkins : I think fixed it by casting to any : (globalThis as any)["prisma"]

3reactions
flybayercommented, Sep 12, 2020

This is a main UX issue with Prisma in Blitz. Would be awesome to have this fixed!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Investigate live reload of Prisma Client with next dev #3615
If I have a Next.js project running with Prisma Client and have a change in the schema.prisma file, then generated a new Client...
Read more >
Best practice for instantiating PrismaClient with Next.js
In development, the command next dev clears Node.js cache on run. This in turn initializes a new PrismaClient instance each time due to...
Read more >
Remix, SQLite, and Prisma, Oh my! | Blog - FullStackFish
We should now have a dev.db file in the prisma folder next to our schema.prisma file. Launch prisma studio to see the results....
Read more >
How to use Prisma in a Next.js app - Daily.dev
In this post, we will learn how to use Prisma, an ORM for JavaScript and TypeScript, in a Next.js app.
Read more >
tRPC - Move Fast and Break Nothing. End-to-end typesafe ...
End-to-end typesafe APIs made easy. Automatic typesafety & autocompletion inferred from your API-paths, their input data, & outputs ‍
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found