just created new app, trying to create first user, user.create is failing
Obviously I could try to debug this, but was surprised it failed on the first db interaction. Any ideas?
Node v18.20.2
Wasp 0.13.2
7 Replies
Hi @KrustyP. 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, there could be a few reasons why the
user.create
function is failing. Here are a few things you could check:
1. Database Initialization: There was a recent issue where Wasp was not able to initialize (create) the database for a project. The issue was that after setting the database URL and running wasp db migrate-dev
or wasp start
, Wasp would report that the database doesn't exist and would not create it (source (https://github.com/wasp-lang/wasp/issues/1435)). Make sure your database is properly initialized.
2. Prisma Version: There was an issue where if there is a package.json
above the Wasp project, the Prisma version from it will be used (source (https://github.com/wasp-lang/wasp/issues/787)). Ensure that the correct Prisma version is being used.
3. Node Version: Wasp requires a specific Node version to run correctly. There have been issues reported where Wasp was not compatible with the installed Node version (source (https://github.com/wasp-lang/wasp/issues/1526), source (https://github.com/wasp-lang/wasp/issues/1618)). However, your Node version (v18.20.2) should be compatible with Wasp.
4. User Creation Function: There was a suggestion to remove the createNewUser()
function and replace it with direct invocations of the Prisma client (source (https://github.com/wasp-lang/wasp/issues/150)). If you're using this function, try replacing it with direct invocations of the Prisma client.
If none of these suggestions help, it would be helpful to see the exact error message you're getting when user.create
fails. This could provide more insight into what might be going wrong.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @KrustyP, 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?Obviously I could try to debug thisPlease do 😄 The error message says you are not providing the required fields for the user object? Please share snippets of code you are using so we can see what's going on.
Ok, but is this normal for a freshly created wasp app to just not work?
I'm just trying to get a feel for how much pain there might be ahead of me. I chose the only option available for auth, which was username/password. The signup form doesn't accept an email so not sure how that is supposed to be provided (out of the box). model User { id Int @id @default(autoincrement()) email String @unique password String name String phone String smsOptIn Boolean @default(false) events Event[] Participant Participant[] auth Auth? } I guess I should say this is using what I see now is classified as experimental AI-generated app.
I'm just trying to get a feel for how much pain there might be ahead of me. I chose the only option available for auth, which was username/password. The signup form doesn't accept an email so not sure how that is supposed to be provided (out of the box). model User { id Int @id @default(autoincrement()) email String @unique password String name String phone String smsOptIn Boolean @default(false) events Event[] Participant Participant[] auth Auth? } I guess I should say this is using what I see now is classified as experimental AI-generated app.
Ok, but is this normal for a freshly created wasp app to just not work?If you generated your app with AI, of course 😄 Mage apps don't work most of the time, it's a good start and you have to sometimes fix a thing or two. Wasp is a full-stack framework and not a no-code / low-code solution. We have extensive docs to help https://wasp-lang.dev/docs We have a bunch of example apps to get inspired e.g. https://github.com/wasp-lang/lazy-card-generator or https://github.com/wasp-lang/ask-the-documents
Introduction | Wasp
If you are looking for the installation instructions, check out the Quick Start section.
GitHub
GitHub - wasp-lang/lazy-card-generator: Demonstration of Wasp and S...
Demonstration of Wasp and Supabase working together, using Llama 3 and SDXL to generate greeting cards! - wasp-lang/lazy-card-generator
GitHub
GitHub - wasp-lang/ask-the-documents: Ask The Documents (Embeddings...
Ask The Documents (Embeddings / ChatGPT) with Wasp & PG Vector - wasp-lang/ask-the-documents
@KrustyP ah yes sorry about that, you are right, Wasp AI (Mage) can make up stuff sometimes! SO yeaah, here it imagine that user should have all these fields, but it didn't adapt the singu pform. You can adapt it though, check it out here https://wasp-lang.dev/docs/auth/overview#customizing-the-signup-process
Thanks. I think the opensaas package is a much better starting point. I've tried a number of times and have yet to get an AI generated app that does much successfully. But it's cool!
True, open-saas is quite better if it fits your needs -> I would say usemage.ai is more useful for experimenting at this point, getting an idea of what an app could look like! It would be great to make usemage.ai better in the future, once we catch some more time!