Comments (1)
I ran into the same issue (I probably did the same thing you did), and after poking around a bit I think I may know what the problem is.
The PlanetScale Prisma adapter is an preview feature, and needs to be enabled thusly in the schema.prisma
file. This is by default in the repo when you initially create it (when you run npx create-t3-app@latest
, you get a schema.prisma
file that looks like this)
// 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"
previewFeatures = ["driverAdapters"] // this line is what enables the prisma adapters, see https://github.com/prisma/prisma/discussions/21347
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
// If you have enabled foreign key constraints for your database, remove this line.
relationMode = "prisma"
}
model Post {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([name])
}
But, when you go to set up a planetscale DB in the planetscale app, they give you a schema.prisma
file to copy into your repo when you initialize your DB, and the schema.prisma file they give you looks like this:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
generator client {
provider = "prisma-client-js"
}
model Post {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([name])
}
If the PlanetScale driver adapter isn't enabled, then npm i
for those adapter features will fail.
So, the problem here is that the planetscale docs don't include the planetscale driver features by default, and my guess is you copied them over and the install failed (I did the same thing initially!)
If you include the
previewFeatures = ["driverAdapters"]
in the schema.prisma
file, the install should work great. Hope this helps!
from create-t3-app.
Related Issues (20)
- docs: Installation documentation says "three commands" but lists four
- feat: PlanetScale w/ foreign key constraints HOT 1
- feat: use `#!/usr/bin/env bash` in all scripts
- bug: NextAuth redirecting to "/login" after authentication & signing out. HOT 8
- bug: "Cannot use namespace 'Database' as a type." TS error when using drizzle & better-sqlite-3 on a brand new T3 app HOT 2
- bug: `.env.js` always validates `DATABASE_URL` for `YOUR_MYSQL_URL_HERE` even when using a different database provider HOT 1
- bug: Start database script doesn't generate url encoded database password HOT 1
- bug: inconsistent dynamic loggerLink HOT 1
- bug: NextAuth (Auth.js) with Keycloak Provider expects non-existent `refresh_expires_in` field under `Account` table HOT 1
- bug: escaped newline in `echo` does not display properly HOT 1
- make it clear `start-database.sh` is optional
- feat: is this template good for t3 collection page? HOT 1
- feat: remove planetscale cli option HOT 1
- bug: When NextAuth authentication provider is selected, the Next Steps section need to indicate setting up Discord client info in .env file HOT 3
- bug: Error: Tried to access "$types.prototype" which is not available at runtime HOT 2
- bug: 'Error: Tried to access "$types.prototype" which is not available at runtime' (tRPC error when using --turbo flag)
- bug: Invalid environment variables when running on local
- bug: db:push throws "invalid url" HOT 6
- tRPC is not working properly in server component in App router due to root.ts file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-t3-app.