#Error at adding Prisma 6.0.1 to NextJs 15: can-connect-to-database

4 messages · Page 1 of 1 (latest)

normal anvil
#

I was trying to add Prisma to an existing NextJs 15 project:

According to Prisma doc https://www.prisma.io/docs/getting-started/quickstart-sqlite

pnpm dlx prisma init --datasource-provider sqlite

I added my own Snippet model into ./prisma/schema.prisma

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

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

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

model Snippet {
  id        Int     @id @default(autoincrement())
  title     String
  code       String
}

Then I ran Prisma migration command:

pnpm dlx prisma migrate dev       

Then in my terminal I got:

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "dev.db" at "file:./dev.db"

Error: Schema engine exited. Error: Command failed with exit code 1: 
/home/user1234/.cache/pnpm/dlx/b4kwuke4fcm2ppufregi7l7yfi/193ad3f76d0-19fd8/
node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines/
schema-engine-debian-openssl-3.0.x cli --datasource <REDACTED> can-connect-to-database

and no new SQL migration file was generated for the migration in the prisma/migrations

Get started with Prisma ORM in 5 minutes. You will learn how to send queries to a SQLite database in a plain TypeScript script using Prisma Client.

eager python
#

Hey @normal anvil 👋

Does this error happen only with Prisma 6?
Does it work with version 5.22?

normal anvil
#

Hello Nurul, after downgrading to prisma 5.22, the error remains:

Error: Schema engine exited. Error: Command failed with exit code 1: /home/user1234/.cache/pnpm/dlx/b4kwuke4fcm2ppufregi7l7yfi/193b4e9b095-5502/node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x cli --datasource <REDACTED> can-connect-to-database
normal anvil
# eager python Hey <@282039750808829952> 👋 Does this error happen only with Prisma 6? Does i...

this seems to be happening only for Linux... my environment:
OS: Linux Mint 22 Wilma based on Ubuntu 24.04 noble
Database: using a plain TypeScript project and a local SQLite database file as described in the doc Quick Start page https://www.prisma.io/docs/getting-started/quickstart-sqlite
Node.js version: v22.12.0
Pnpm version: 9.15.0
I made an issue on Prisma Github. There is a bug at Prisma QuickStart migration. See QA discussion: https://github.com/prisma/prisma/discussions/25835