language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

The Prisma vscode extension does not resolve files that are inside nested directories when using `prismaSchemaFolder`

Open tom-groves opened this issue 1 year ago • 2 comments

Thanks for the excellent work on Prisma 😄 I'm encountering a bug as follows:

Bug description

I am using the prismaSchemaFolder preview feature. My source code is structured by module, i.e.:

src
├── modules
│   ├── company
│   │   ├── company.graphql
│   │   ├── company.prisma
│   │   └── company.resolver.ts
│   ├── project
│   │   ├── project.graphql
│   │   └── project.prisma
└── schema.prisma

The Prisma CLI is able to correctly generate based on the nested Prisma files, but the VS Code extension is not, as indicated in the following screenshot:

Screenshot 2024-11-04 at 10 43 25

How to reproduce

  1. Clone the repository at https://github.com/tom-groves/prisma-extension-nested-schema-folders-example
  2. Open in VS Code
  3. Running npx prisma generate will generate the Prisma Client successfully
  4. Nested Prisma schemas, such as src/modules/company/company.prisma, will be in an error state

Expected behavior

The Prisma extension resolves the various nested .prisma files.

tom-groves avatar Nov 04 '24 10:11 tom-groves

I knew about the workaround in the comments of the discussion. It might be helpful for someone.

nissy-dev avatar Mar 08 '25 03:03 nissy-dev

I think this issue was resolved by https://github.com/prisma/prisma/pull/27075 If you can use prisma.config.ts, lsp works correctly.

nissy-dev avatar May 18 '25 01:05 nissy-dev