vercel / ai-chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel
https://chat.vercel.ai
Other
6.54k stars 2.05k forks source link

Failing to signup when running app locally #450

Closed chrisg220 closed 2 days ago

chrisg220 commented 3 days ago

I am seeking help debugging my authentication error for the ai-chatbot template app so that I can login and play with the example chatbot application. However, I'm failing to even create a user via the UI login page.

I followed every step of the README. I renamed .env.example to .env.local and inserted my private keys for OPENAI_API_KEY, AUTH_SECRET, BLOB_READ_WRITE_TOKEN, and POSTGRES_URL. I have the app running locally on localhost:3000. I am trying to sign up by filling in an email address and password. But when I press sign up, I get the following errors in the console.

// console output

pnpm dev

> ai-chatbot@0.1.0 dev /Users/christophergonzales/Projects/ai-chatbot
> next dev --turbo

  ▲ Next.js 15.0.0-canary.152 (turbo)
  - Local:        http://localhost:3000
  - Environments: .env.local

 ✓ Starting...
 ✓ Compiled in 271ms
 ✓ Ready in 990ms
 ○ Compiling /register ...
 ✓ Compiled /register in 2.5s
 GET /register 200 in 2776ms
Failed to get user from database
 POST /register 200 in 260ms
Screenshot 2024-10-18 at 6 02 21 PM
chrisg220 commented 2 days ago

I got this to work by manually migrating and building (shown below), and then re-starting the app.

tsx db/migrate && next build

I believe I followed all the steps correctly in the README, so I expected it to work when I started the app. I just wanted to follow up with my resolution in case:

  1. this is a "missing step" in the README
  2. I actually did something out of order, and anyone else who does can learn how to resolve a similar issue for them.
zdvman commented 19 hours ago

Hi, did you solve the issue? I have the same problem.

chrisg220 commented 6 hours ago

@zdvman Yes my problem was solved. Did you have the same error as me? And did you try running the commands I wrote above? What are you seeing now?