W
Wasp-langβ€’4mo ago
Goldsoull

error schema.prisma:63

Hi Guys, i get the following error when creating a new project in wasp it says schema.primsa is already in use but i completely removed the dir where the previous project was and i tried to uninstall wasp / clean wasp nothing yet has worked. What else can i do? Thank you. error: The model "Session" cannot be defined because a model with that name already exists. [ Db !] --> schema.prisma:63
15 Replies
kapa.ai
kapa.aiβ€’4mo ago
Hi @Goldsoull. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message you're seeing suggests that there's a duplicate model named "Session" in your schema.prisma file. This could happen if you've accidentally defined the same model twice in your Prisma schema. Here are a few steps you can take to resolve this issue: 1. Open your schema.prisma file and look for any duplicate definitions of the "Session" model. If you find any, remove the duplicates. 2. After making changes to your Prisma schema, you'll need to run a database migration. You can do this by running the command wasp db migrate-dev in your terminal. This instructs Prisma to create a new database migration and apply it to the database. source (https://wasp-lang.dev/docs/tutorial/entities) 3. If the error persists, you might want to try running wasp clean and then wasp start again. This has helped resolve similar issues in the past. source (https://discord.com/channels/686873244791210014/1204021576979324949) If none of these steps resolve your issue, it might be helpful to provide more information about your schema.prisma file and the exact steps you're taking when you encounter this error. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Goldsoull, 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?
Filip
Filipβ€’4mo ago
Hey @Goldsoull, you've unfortunately ran into Wasp's edge case. Quick solution: Rename your entity to something other than Session. Explanation: Session is a reserved name for entities because Wasp already defines the Entity that's called Session under the hood. When you name one of your entities Session, it creates a name clash (Prisma doesn't allow two entities with the same name). @miho I seem to remember we were trakcing this somewhere. Do we have an issue?
miho
mihoβ€’4mo ago
I don't think we ever created an issue for this particular Prisma issue, we should ideally detect these name clashes between internal models and user models and output a good error message that says what you explained here πŸ˜„ Would you mind creating this issue?
Filip
Filipβ€’4mo ago
GitHub
Prevent name clashes between Wasp's and user's Entities Β· Issue #19...
If a user creates and entity and its name matches one of Wasp's internal entities (e.g., Session), they get an error due to a name clash: error: The model "Session" cannot be defined ...
Goldsoull
Goldsoullβ€’4mo ago
Hi Sodic, thank you for the fast response, but i have to admit i still don't know how to change the "session" name at all. What kind of code do i need to type in to change the name of the session? Yes, i am new to this as you can see : )
Filip
Filipβ€’4mo ago
Haha @Goldsoull, no problem. Just rename the entity named Session in your main.wasp file something to other tham Session. If you're stil confused, send the wasp file and I'll take care of it πŸ™‚
Goldsoull
Goldsoullβ€’4mo ago
Goldsoull
Goldsoullβ€’4mo ago
I think you mean this one?
Filip
Filipβ€’4mo ago
That's the one, I'll take a look tomorrow
Filip
Filipβ€’4mo ago
Here you go πŸ˜„
No description
Goldsoull
Goldsoullβ€’4mo ago
This Worked, but now...
MEE6
MEE6β€’4mo ago
Wohooo @Goldsoull, you just became a Waspeteer level 1!
Goldsoull
Goldsoullβ€’4mo ago
No description
Goldsoull
Goldsoullβ€’4mo ago
Changing the session name has worked, but now SDK build failed - Cannot find module "wasp/ext-src/actions.js"
Filip
Filipβ€’3mo ago
Hey @Goldsoull, we can't really say much more without seeing your full app. If you don't mind sharing it, I can maybe help you out.
Want results from more Discord servers?
Add your server
More Posts
How to change logo in google searchWhen I search for my website on google. The results show the logo for wasp on the left of the link iHow to replace wasp logo as favicon in tabI've deployed my website using wasp deploy fly deploy. In my localhost, I was able to replace the faWhat file contains the styles for the login and signup pageI'm trying to edit the styling of the Auth UI Component because it doesn't fit with the color schemeWhen using GitHub codespaces, how to setup Google Oauth for developmentWhen using GitHub codespaces, how to setup Google OAuth for development/I tried using "wasp ai" like this video https://www.youtube.com/watch?v=0 shows but it doesn't workGenerating plan (slowest step, usually takes 30 to 90 seconds)... Code agent failed with the http erOauth provider flow redirects to localhost:3001 instead of 3000I'm creating a new WASP app from scratch, I've added the Google Provider. My server by default runsGetPaginatedTransactions problem with query with decimalsHello I made simple object entity Transaction {=psl id Int @id Prisma update Update available 4.16.2 -> 5.12.1Can I update prisma in wasp project? What impact it would have? β”‚ Update available 4.16.2 -> 5.12.Is there an easy way to use another Tailwind Component Library or shadcn?I tried setting up daisyui with the existing CSS and it messed up everything. I am wondering if therIssue with OpenAI APIWhy is there a red line under chat? The example `export const generateGptResponse: GenerateGptRespon