Skip to content

Failed to load config (Cannot use 'in' operator to search for 'kind' in typeChoice) #2012

Open

Description

@DanielC49

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

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions