create-t3-app help : something weird with .env

I followed along with the T3 Stack Tutorial - FROM 0 TO PROD FOR $0 video. I have watched these steps in the video 4 times now to make sure I've followed them correctly. My .env is set up. The DATABASE_URL is added into Vercel as an Environment Variable. I changed schema.prisma. My .env looks like the below. It runs with npm run dev.
PLANETSCALE_PRISMA_UN=blahblahblfklsdfklsdf
PLANETSCALE_PRISMA_PW=pscale_pw_asdfasdfasdfasdfasdfasdf
DATABASE_URL=mysql://asdfasdfasdfasdfasdfasfasdf:pscale_pw_asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf@aws.connect.psdb.cloud/sdfsfsdfdfs?sslaccept=strict
PLANETSCALE_PRISMA_UN=blahblahblfklsdfklsdf
PLANETSCALE_PRISMA_PW=pscale_pw_asdfasdfasdfasdfasdfasdf
DATABASE_URL=mysql://asdfasdfasdfasdfasdfasfasdf:pscale_pw_asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf@aws.connect.psdb.cloud/sdfsfsdfdfs?sslaccept=strict
Vercel error:
./src/server/db.ts:18:5
Type error: Type 'PrismaPlanetScale' is not assignable to type 'never'.
16 | log:
17 | env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
> 18 | adapter: new PrismaPlanetScale(client),
| ^
19 | });
20 |
21 | if (env.NODE_ENV !== "production") globalForPrisma.prisma = db;
Error: Command "npm run build" exited with 1
./src/server/db.ts:18:5
Type error: Type 'PrismaPlanetScale' is not assignable to type 'never'.
16 | log:
17 | env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
> 18 | adapter: new PrismaPlanetScale(client),
| ^
19 | });
20 |
21 | if (env.NODE_ENV !== "production") globalForPrisma.prisma = db;
Error: Command "npm run build" exited with 1
4 Replies
Mikitz
Mikitz•5mo ago
Turned out it was because I enabled NextAppRouter. Once disabled, everything worked.
Yorkshire Geek
Yorkshire Geek•5mo ago
I have the same error, could you tell me how you disabled NextAppRouter please.
Mikitz
Mikitz•5mo ago
I did not disable it. Instead, I just initialized a brand new project with npm create t3-app@latest and made sure to not use NextAppRouter
Yorkshire Geek
Yorkshire Geek•5mo ago
thanks. i will try again. 🙂