Prisma Schema Config
I am encountering some issues with my data model when I upgraded to version 6 of prisma. The issue I am encountering is when I navigate to the model, it will give me linting errors related to the redundancy of the model. Any time I click into any of the data models, the linting errors are removed. I have screenshot what this looks like in vscode.
Here is my config. My current assumption is that the config is currently configured where it is identifying the prisma client schema along with all of my other schema files. I am curious what the fix is for this though. When I try to modify the filepath to include special characters in the config (i.e., schema:"./prisma/models/*.prisma" it does not recognize this pattern). Curious how I should modify my config.
Thanks for any help



5 Replies
You opted for speed from this bot. Let's conjure up an answer right now!
It sounds like Prisma is indexing extra .prisma files (e.g., generated copies or those under migrations), causing “duplicate source/model” lint errors. Multi-file schemas don’t use globs; you must point Prisma to a directory, and it will recursively load all .prisma files inside it. Fixes:
- Point schema to the folder, not a file or a glob:
- prisma.config.ts:
Place prisma.config.ts at project root, not inside prisma/ (Config reference, Common patterns).
- Alternatively, package.json: Or CLI: --schema ./prisma (Schema location: usage). - Ensure the datasource-defining schema (e.g., schema.prisma) and the migrations folder are siblings (same level). Do not put generated or other schema copies inside the schema folder; they’ll be picked up as duplicates (Schema location: migrations placement, Common patterns: migrations placement). If you generated a client into prisma/generated and it writes a schema copy, move that generated folder outside prisma to avoid duplicates (Issue comment explanation). - Do not use globs like "./prisma/models/*.prisma" in schema config; Prisma expects a folder path and will recurse automatically ([Schema location: usage](https://www.prisma.io/docs/orm/p risma-schema/overview/location#multi-file-prisma-schema)). - If you previously placed prisma.config.ts under prisma/, move it to root and set schema to "prisma" so both schema.prisma and subfolders (models/) are discovered; otherwise files outside the specified folder won’t be included (Issue guidance). - If lint errors come from migration schemas or bundled schema copies, exclude those paths from your linter or ensure they’re not under the configured schema directory (Issue context and fixes, 27495). If after these changes you still see duplication, check for any .prisma files under prisma/generated or migrations that mirror your main schema and relocate or ignore them. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
- Alternatively, package.json: Or CLI: --schema ./prisma (Schema location: usage). - Ensure the datasource-defining schema (e.g., schema.prisma) and the migrations folder are siblings (same level). Do not put generated or other schema copies inside the schema folder; they’ll be picked up as duplicates (Schema location: migrations placement, Common patterns: migrations placement). If you generated a client into prisma/generated and it writes a schema copy, move that generated folder outside prisma to avoid duplicates (Issue comment explanation). - Do not use globs like "./prisma/models/*.prisma" in schema config; Prisma expects a folder path and will recurse automatically ([Schema location: usage](https://www.prisma.io/docs/orm/p risma-schema/overview/location#multi-file-prisma-schema)). - If you previously placed prisma.config.ts under prisma/, move it to root and set schema to "prisma" so both schema.prisma and subfolders (models/) are discovered; otherwise files outside the specified folder won’t be included (Issue guidance). - If lint errors come from migration schemas or bundled schema copies, exclude those paths from your linter or ensure they’re not under the configured schema directory (Issue context and fixes, 27495). If after these changes you still see duplication, check for any .prisma files under prisma/generated or migrations that mirror your main schema and relocate or ignore them. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
the prisma file is under node_modules/.prisma/client/schema
Is your prisma.config.ts inside the prisma folder?
It is at the root of the directory

I have the same error, any ideas @Nurul?