Skip to content

Prisma VS Code extension with mongodb provider crashes when a relation field/type is not defined  #1466

Closed
prisma/prisma-engines
#4087
@KarthikRaju391

Description

Bug description

I have set up Prisma with MongoDB provider but every time I try to edit the file, the following error is thrown.
image

And this is what the terminal output of the Prisma language server shows:
image
Prisma

How to reproduce

  1. Set up a project with MongoDB as the provider for Prisma.
  2. Try editing the prisma.schema fileMongodb

Expected behavior

No response

Prisma information

datasource db {
  provider = "mongodb"
  url      = env("DATABASE_URL")
}

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["mongodb"]
}

model User {
  id        String    @id @default(auto()) @map("_id") @db.ObjectId
  // account   Business?
  address   Address[]
  dob       DateTime?
  email     String    @unique
  firstName String?
  lastName  String?
  phone     String?
  gender    String?
  metadata  Json?
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
}

Environment & setup

  • OS: WSL in Windows 11
  • Database: MongoDB
  • Node.js version: 16.19.0

Prisma Version

prisma                  : 5.0.0
@prisma/client          : 5.0.0
Current platform        : debian-openssl-3.0.x
Query Engine (Node-API) : libquery-engine 6b0aef69b7cdfc787f822ecd7cdc76d5f1991584 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Schema Engine           : schema-engine-cli 6b0aef69b7cdfc787f822ecd7cdc76d5f1991584 (at node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Schema Wasm             : @prisma/prisma-schema-wasm 4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584
Default Engines Hash    : 6b0aef69b7cdfc787f822ecd7cdc76d5f1991584
Studio                  : 0.487.0
Preview Features        : mongoDb

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions