Prisma types are not regeneraetd until Visual Studio Code restarts
See original GitHub issueBug description
When adding a new model to my schema, Visual Studio Code fails to realize that I can use this as a property on the prisma object until I restart the program. Perhaps this is a Visual Studio Code bug instead? Sorry if so and feel free to close.
How to reproduce
- Open schema and a .ts file in Visual Studio Code
- Add a model to your schema, or change the name of your schema
- Try to find the new or renamed schema in your .ts file
- It cannot
Expected behavior
I would expect the new schema values to be available in my .ts files.
Prisma information
No special schema in place. You can reproduce this with this simple code in your .ts file:
const test = await prisma.schemaName.findMany();
Environment & setup
- OS: Mac OS
- Database: SQLite
- Node.js version: v14.4.0
- Prisma version
2.21.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Have to restart vscode after prisma generate #3474 - GitHub
I have to restart ascode after running prisma generate in order to use autocompletion (prisma extension is installed).
Read more >Prisma Schema not updating properly after adding new fields
Restart VS Code language server (Hit Ctrl + Shift + P , then search for Restart TS server )
Read more >Improving the Prisma VS Code Extension with WebAssembly
Learn about the Prisma schema and how we improved reliability and simplified the Prisma Visual Studio Extension with Rust and WebAssembly.
Read more >Prisma client breaks when I add a field to a model
I'm trying to add a new field to an existing model, and I keep hitting a mysterious Prisma error. Here's what I did:...
Read more >Fullstack ecommerce site using Nextjs, Supabase, prisma and ...
To put it another way, this tutorial will not only teach you how to ... For this article tutorial, we'll be using the...
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 FreeTop 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
Top GitHub Comments
Hmm. Well if I ever come across another reproducible case I’ll attempt to document it. In the meantime, when in doubt I can just
npx prisma generate
excessively 😉VSCode and Typescript are not super big friends when it comes to reload type definitions. We actually do some fancy stuff in our VSCode extension to try to work around that, but it does not work all the time (and unfortunately there is no way for us to recognize). Maybe you hit one of these cases.