Migration to 0.14 Issue with Prisma
My Auth is not recognizing the User field from my prisma file. Here is the main wasp declaration: app Realti {
wasp: {
version: "^0.14.0"
},
title: "Realti",
auth: {
userEntity: User,
methods: {
usernameAndPassword: {
userSignupFields: import { userSignupFields } from "@src/components/Reusables/extrasignups",
},
},
onAuthFailedRedirectTo: "/login",
},
db: {
system: PostgreSQL
}
} but my error is Type error:
Undefined identifier: User.
My Prisma is: datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement()) first_name String @default("") last_name String @default("") favorites Favorite[] }
id Int @id @default(autoincrement()) first_name String @default("") last_name String @default("") favorites Favorite[] }
9 Replies
Hi @Sam Jakshtis. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided, it seems like you're having trouble with the User entity not being recognized in your Wasp application. This could be due to a variety of reasons, such as incorrect file structure or missing imports.
However, I'm afraid I can't provide a specific solution as the knowledge sources provided do not contain information directly related to your issue.
I would recommend checking the Wasp documentation or their GitHub issues for similar problems. It might also be helpful to ensure that your Prisma schema is correctly set up and that the User model is properly imported in your Wasp files.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sam Jakshtis, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
What is your Wasp version? Run
wasp version
to see it@miho Haha my b, just need to download new version correct? I am on 13.2
Yep yep, just run
curl -sSL https://get.wasp-lang.dev/installer.sh | sh
to upgrade π@miho Done, but getting this error? (Also documenting should anyone else experience similar difficulties). git:(main) β wasp db migrate-dev
π --- Compiling wasp project... --------------------------------------------------
β --- [Error] Your wasp project failed to compile: -------------------------------
- /Users/samueljakshtis/Desktop/github/Realti/main.wasp @ 16:13-22
Type error:
Undefined identifier: PostgreSQL
15 | db: {
16 | system: PostgreSQL,
17 | }
There is a migration guide that will help you go from 0.13.2 to 0.14.0: https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14 π let me know if that helps
Migration from 0.13.X to 0.14.X | Wasp
This guide only covers the migration from 0.13.X to 0.14.X. If you are migrating from 0.11.X or earlier, please read the migration guide from 0.11.X to 0.12.X first.
@miho Yes I have been following it, do the queries and actions on mani.wasp stay the same?
Also on the userEntity
Wohooo @Sam Jakshtis, you just became a Waspeteer level 4!
Ah figured it out, needed to remove db system