-
Notifications
You must be signed in to change notification settings - Fork 2.1k
prisma generate, typings not updating in VSCode unless IDE is restarted. #14722
Copy link
Copy link
Open
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.topic: editor
Description
Bug description
Changing the type of a field in a model, or adding a new field, then running the command npx prisma db push and npx prisma generate are not updating the typings in my IDE, unless I restart VSCode after making my schema changes and running those commands.
During prototyping where I am frequently updating my models, this disrupts my workflow significantly.
How to reproduce
- Add a new field to a model
- Run
npx prisma db pushandnpx prisma generate - The field created in step 1 will not be recognized when executing await prisma.model.create(data: {...}).
- Restart VSCode
- Step 3 error goes away.
Expected behavior
The IDE recognizes the updates to the model and does not require a restart.
Prisma information
<!-- Do not include your database credentials when sharing your Prisma schema! -->
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model YoutubeAccount {
username String @unique
password String
profile_path String
proxy String
video_templates VideoTemplate[]
}
model VideoTemplate {
id Int @id @default(autoincrement())
inputDirs String[]
title String
description String
tags String[]
clipCount Int
duration Int
width Int
height Int
YoutubeAccount YoutubeAccount? @relation(fields: [youtubeAccountUsername], references: [username])
youtubeAccountUsername String?
}
Environment & setup
- OS:
- Windows
- Database:
- PostgreSQL
- Node.js version:
- Node 18.4.0
Prisma Version
npx prisma -v
Environment variables loaded from .env
prisma : 4.2.0
@prisma/client : 4.2.0
Current platform : windows
Query Engine (Node-API) : libquery-engine 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine : migration-engine-cli 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary : prisma-fmt 2920a97877e12e055c1333079b8d19cee7f33826 (at
node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : 2920a97877e12e055c1333079b8d19cee7f33826
Studio : 0.469.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.topic: editor