Skip to content

prisma.config.ts - slow formatting #28162

Open

Description

@inhanbyeol94

Bug description

nestjs + prisma + webstorm (lang)

Since starting to use prisma.config.ts, it has been inconvenient that modifying and saving schema files takes over 10 seconds.

There are many models contained within 7 Prisma schema files.

The Prisma language server console output shows no specific logs, so I don't know how to improve this again.

This issue occurs regardless of whether using VS Code or WebStorm.
(The WebStorm language server is outdated, so I'm using a separately updated version. Even when using the latest version of the Prisma extension in VS Code, the same issue persists.)

Image

The prisma.config.ts file is not doing anything special:

import dotenv from 'dotenv';
import { PrismaConfig } from 'prisma';
import path from 'path';

dotenv.config();

export default {
  schema: path.join('prisma'),
  migrations: {
    path: path.join('prisma', 'migrations'),
    seed: 'ts-node -r tsconfig-paths/register --transpile-only prisma/seeds/core/execute.ts',
  },
  // views: {
  //   path: path.join('src', 'database', 'views'),
  // },
  // typedSql: {
  //   path: 'src/database/typed-sql',
  // },
} satisfies PrismaConfig;

Severity

🚨 Critical: Data loss, app crash, security issue

Reproduction

Expected vs. Actual Behavior

Frequency

Consistently reproducible

Does this occur in development or production?

Only in development (e.g., CLI tools, migrations, Prisma Studio)

Is this a regression?

Workaround

Prisma Schema & Queries

// Add relevant schema.prisma snippet
// Add relevant Prisma Client query

Prisma Config

// Add your `prisma.config.ts`

Logs & Debug Info

// Debug logs here

Environment & Setup

  • OS:
  • Database:
  • Node.js version:

Prisma Version

// Prisma version output

Activity

  1. added
    bug/1-unconfirmed
    on Sep 29, 2025
  2. samirant15 commented on Oct 7, 2025

    @samirant15

    I'm having the same issue, it is painful to wait so long on each save 😩

  3. wh1337 commented on Oct 16, 2025

    @wh1337

    Can confirm that this is extremely slow, upwards of 3 minutes just to try and format and save the prisma file. Getting the following abridged logs:

    Error - 2:37:08 PM] Request textDocument/documentSymbol failed.
    Error: Connection got disposed.
    ....
    [Info  - 2:37:08 PM] Default version of Prisma 'prisma-schema-wasm': 272a37d34178c2894197e17273bf937f25acdeac
    [Info  - 2:37:08 PM] Extension name @prisma/language-server with version 6.17.1
    [Info  - 2:37:08 PM] Prisma Engines version: 6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac
    [Info  - 2:37:08 PM] Prisma CLI version: 6.17.1
    

    Our current schema.primsa

    generator client {
      provider        = "prisma-client"
      output          = "../src/lib/generated/prisma"
      previewFeatures = ["fullTextSearchPostgres"]
      engineType      = "client"
    }
    
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    

    and our prisma.config.ts

    import "dotenv/config";
    import path from "node:path";
    import { defineConfig } from "prisma/config";
    
    export default defineConfig({
      schema: path.join('prisma'),
    })
  4. xhp443 commented on Oct 23, 2025

    @xhp443

    move prisma/schema.prisma to prisma/models/schema.prisma can fixed. Why?

  5. m9tdev commented on Oct 23, 2025

    @m9tdev

    Same problem here. Formatting is unbearably slow. Moving the schema file didn't make a difference for me. Reverted for now

  6. xhp443 commented on Oct 24, 2025

    @xhp443
  7. m9tdev commented on Oct 24, 2025

    @m9tdev

    Thanks! Moving schema.prisma to prisma/models/schema.prisma and also adding "models" to the schema path in the config works indeed!

    export default defineConfig({
      schema: path.join("prisma", "models"),
    })
    
  8. DubG1 commented on Nov 25, 2025

    @DubG1

    Thanks! Moving schema.prisma to prisma/models/schema.prisma and also adding "models" to the schema path in the config works indeed!

    export default defineConfig({
      schema: path.join("prisma", "models"),
    })
    

    Wow this fixe it, we already had models split up into multiple files so all i did was adding this to the schema in the config and now it saves and formats instantly thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/1-unconfirmedkind/bugtopic: configurationtopic: vscode extension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions