PrismaP
Prisma9mo ago
4 replies
Ơ

prisma generate for .mjs

Hi,

Currently I want to generate with .mjs file but when I run npx prisma generate I getg this error
Generated file extension "mjs" is unexpected and may be a mistake. Expected one of: "ts", "mts", "cts"
Error: 
Cannot read properties of undefined (reading 'filter')


Here's my
schema.prisma
file
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
  provider               = "prisma-client" // no `-js` at the end
  output                 = "../src/generated/prisma" // `output` is required
  runtime                = "nodejs"
  moduleFormat           = "esm"
  generatedFileExtension = "mjs"
  importFileExtension    = "mjs"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
Was this page helpful?