prisma: Webstorm does not understand return types

Bug description

Webstorm does not understand the return types from prisma queries and defined the type as “any” The auto-completion on the query parameters works fine, so this is unrelated to #2359

How to reproduce

Webstorm Example

Expected behavior

VSCode Example

Prisma information

generator client {
  provider = "prisma-client-js"
}

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

model user {
  id                       BigInt          @id @default(autoincrement())
  email                    String          @unique(map: "user_email_unique") @db.VarChar(255)
  username                 String?         @unique(map: "user_username_unique") @db.VarChar(255)
  password_hash            String?         @db.VarChar(255)
  first_name               String?         @db.VarChar(255)
  last_name                String?         @db.VarChar(255)
  email_confirmed          Boolean         @default(false)
  email_confirmation_token String?         @db.VarChar(255)
  receive_marketing_emails Boolean         @default(true)
  facebook_id              BigInt?         @unique(map: "user_facebook_id_unique")
  created_at               DateTime        @default(now()) @db.Timestamptz(6)
}

Environment & setup

  • OS: Windows
  • Database: PostgreSQL
  • Node.js version: 16.9.1
  • WebStorm version: 2021.2.2 (Build WS-212.5284.41 built on September 14, 2021)

Prisma Version

Environment variables loaded from .env
prisma                  : 3.1.1
@prisma/client          : 3.1.1
Current platform        : windows
Query Engine (Node-API) : libquery-engine c22652b7e418506fab23052d569b85d3aec4883f (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine        : migration-engine-cli c22652b7e418506fab23052d569b85d3aec4883f (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine    : introspection-core c22652b7e418506fab23052d569b85d3aec4883f (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary           : prisma-fmt c22652b7e418506fab23052d569b85d3aec4883f (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash    : c22652b7e418506fab23052d569b85d3aec4883f
Studio                  : 0.423.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

Hi there! I’ll be able to check it in this week.

I think so, yes. But maybe @lenis0012 can confirm.

@JWo1F Could you tell us which version of prisma you are using? Try running npx prisma -v and check your package.json. And which version of WebStorm?