prisma: @prisma/extension-pulse is not exported from package

Bug description

I want to use Prisma Pulse, but when i import (and ofcourse i installed the package with NPM) the package. I get the following error.

./lib/db.ts:2:0 Module not found: Package path . is not exported from package /node_modules/@prisma/extension-pulse (see exports field in /node_modules/@prisma/extension-pulse/package.json)

I’ve checked the node_modules and @prisma/extension-pulse is in there

image

I’m. using NextJS 14.1.4 and Prisma 5.13.0 and @prisma/extension-pulse 1.0.2

How to reproduce

Expected behavior

No response

Prisma information

// prisma/schema.prisma
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

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

enum UserRole {
  ADMIN
  USER
}

model User {
  id                    String                 @id @default(cuid())
  name                  String?
  email                 String?                @unique
  emailVerified         DateTime?
  image                 String?
  password              String?
  role                  UserRole               @default(USER)
  accounts              Account[]
  isTwoFactorEnabled    Boolean                @default(false)
  twoFactorConfirmation TwoFactorConfirmation?
  Team                  Team[]
}

model Account {
  id                String  @id @default(cuid())
  userId            String
  type              String
  provider          String
  providerAccountId String
  refresh_token     String? @db.Text()
  access_token      String? @db.Text()
  expires_at        Int?
  token_type        String?
  scope             String?
  id_token          String? @db.Text()
  session_state     String?

  user User @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([provider, providerAccountId])
}

model VerificationToken {
  id      String   @id @default(cuid())
  email   String
  token   String   @unique
  expires DateTime

  @@unique([email, token])
}

model PasswordResetToken {
  id      String   @id @default(cuid())
  email   String
  token   String   @unique
  expires DateTime

  @@unique([email, token])
}

model TwoFactorToken {
  id      String   @id @default(cuid())
  email   String
  token   String   @unique
  expires DateTime

  @@unique([email, token])
}

model TwoFactorConfirmation {
  id String @id @default(cuid())

  userId String
  user   User   @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([userId])
}

model Team {
  id     String @id @default(cuid())
  name   String
  userId String
  user   User   @relation(fields: [userId], references: [id], onDelete: Cascade)
}

Environment & setup

NextJS 14.1.4

Prisma Version

Prisma 5.13.0 Pulse 1.0.2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

Also got this problem using Next.js + next-auth, importing from @prisma/extension-pulse/node fixed the Module not found: Package path . is not exported from package /node_modules/@prisma/extension-pulse.

However it now fails with this error :Module build failed: UnhandledSchemeError: Reading from "node:http" is not handled by plugins (Unhandled scheme).and as @rtbenfield pointed it out, it’s related to code being included on edge environment. next-auth (v5) includes code in middleware. While using prisma + next-auth works on edge environment, using Pulse won’t work because node APIs are not available.

While some options were available before to make next-auth with Prisma work on Edge environment (involving splitting configuration with Edge-compatible functions and non-Edge-compatible functions), Prisma made some work for the ORM to be natively Edge-compliant removing necessity for splitting. Unfortunately, Pulse not supporting Edge environment makes it coming back to the earlier problem.

I have the exact same issue.

yes, exactly, i tried with “customConditions”:[“workerd”] or [“node”]

Actually, I was able to figure what was going wrong in my case. The file that was importing the Pulse-extension was being included in some client-side code. Since the package’s exports specify “node” and “workerd” environments, nothing was obviously being exported for the browser. I’ll fix it in my repo.

Thanks anyway.

Hey folks!

Can you please confirm that you have set customConditions in your “tsconfig.json” file as specified here?

Screenshot 2024-05-13 at 5 32 23 PM

I have the same issue

I’m using it with supabase. I followed the prisms pulse guide for setting up my project.

But the issue right now is that the installed pulse npm package is not recognized as a module