Failed to load config (Cannot use 'in' operator to search for 'kind' in typeChoice)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- next.js, node.js, typescript, vscode
- Domain
- developer-experience, devtools
Research direction
The failing load is in the language server's config loading for prisma.config.ts, so start where the error message 'Failed to load ... Cannot use in operator' is produced and trace how the exported config value is checked for a 'kind' field, such as the typeChoice handling. Reproduce by opening a project whose config uses definePrismaConfig with an orm config, then fix the check so it handles that value. Done when the config loads without the error and the Output panel stays clean.
Written by the indexing model from the issue text.
Description
Bug description
The extension fails to load the config file. It returns the following error:
Prisma could not load "prisma.config.ts". Formatting and other language features are unavailable until the configuration loads.
The Output displays this:
Failed to load c:\users\user\projects\my-project\prisma.config.ts: Cannot use 'in' operator to search for 'kind' in typeChoice
prisma.config.ts
import 'dotenv/config';
import { definePrismaConfig } from '@prisma/cli-engine';
import { defineConfig as ormConfig } from '@prisma/orm-postgres/config';
export default definePrismaConfig({
orm: ormConfig({
contract: "./src/prisma/contract.prisma",
db: {
connection: process.env['DATABASE_URL']!,
},
}),
});
My package.json
{
"name": "my-project",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint",
"contract:emit": "prisma contract emit"
},
"dependencies": {
"@prisma/orm-postgres": "^8.0.0-rc.22",
"next": "16.4.3",
"react": "19.3.0",
"react-dom": "19.3.0"
},
"devDependencies": {
"@prisma/cli-engine": "^0.9.0",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"dotenv": "^18.0.9",
"eslint": "^10.13.0",
"eslint-config-next": "16.4.3",
"prisma": "^8.0.0-rc.29",
"typescript": "^5"
},
"allowScripts": {
"[email protected]": true
}
}
I also tried using the insider version (31.12.17) of the extension.
Environment & setup
- OS: Windows
- Editor: VS Code
- Editor version: 1.144.0
- Extension version: 31.13.0
- Dominant language
- TypeScript
- Stars
- 298
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from prisma/language-tools
-
bug/1-unconfirmed domain/schema kind/bug topic: internal
Difficulty 1/5 Under an hour Newbie friendliness 62/100
prisma/language-tools#1182 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
prisma/language-tools#2006 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
prisma/language-tools#1988 ·
-
prismaSchemaFolder glob pattern uses wrong path separator on Windows, breaking multi-file schema discoveryMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
prisma/language-tools#1985 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
prisma/language-tools#1984 ·
All issues in prisma/language-tools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tashfeenahmed/freellmapi#2305 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
prime-radiant-inc/evener#8335 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel-labs/ui#1921 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
microsoft/monaco-editor#5626 ·
Maintainers usually reply within 1 day