ProKil / sotopia-chatbot

https://sotopia-chatbot.vercel.app
Other
2 stars 0 forks source link

invalid url error localhost:3000 #36

Open zhenwu0831 opened 8 months ago

zhenwu0831 commented 8 months ago

Hi,

I followed the steps in readme to set up the environment variables and try to run locally. Here are the steps I took and the error when accessing localhost:3000:

  • error TypeError: Invalid URL at webpack_require__ (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/webpack-runtime.js:33:42) at eval (./components/login-button.tsx:7:73) at (sc_client)/./components/login-button.tsx (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/app/sign-in/page.js:706:1) at webpack_require__ (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/webpack-runtime.js:33:42)

  • error TypeError: Invalid URL at webpack_require__ (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/webpack-runtime.js:33:42) at eval (./components/login-button.tsx:7:73) at (sc_client)/./components/login-button.tsx (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/app/sign-in/page.js:706:1) at webpack_require__ (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/webpack-runtime.js:33:42)

  • error TypeError: Invalid URL at webpack_require__ (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/webpack-runtime.js:33:42) at eval (./components/login-button.tsx:7:73) at (sc_client)/./components/login-button.tsx (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/app/sign-in/page.js:706:1) at webpack_require__ (/Users/zhenwu/Documents/sotopia/sotopia-chatbot/.next/server/webpack-runtime.js:33:42)

  • wait compiling /api/auth/[...nextauth]/route (client and server)...

  • event compiled successfully in 72 ms (401 modules)

Steps: 1) create a new project (linked to github, deployed) and a KV instance on Vercel ; 2) follow the run locally guidance: Install Vercel CLI: npm i -g vercel Link local instance with Vercel and GitHub accounts (creates .vercel directory): vercel link Download your environment variables: vercel env pull 3) change .env.example to .env, and fill out all the credentials; 4) set const SOTOPIA_SERVER_URL = "http://localhost:3000"; 5) run pnpm install pnpm dev

And this is the log from the vercel project log page: image

ProKil commented 8 months ago

On which url did you deploy the FastAPI server sotopia-chat?

ProKil commented 8 months ago

Assuming you can already run sotopia experiments. Here are the steps you can take:

  1. Setup the fastapi server on localhost:8000. You can check if it works through visiting http://localhost:8000/docs. If you can see all the available apis, it works.
  2. Set up environment variables in .env
  3. run pnpm install and then pnpm dev. The default url is localhost:3000. Visit http://localhost:3000
zhenwu0831 commented 8 months ago

Hi @ProKil Thank you! I think it's step 1 about setting up the fastapi server that throws me off a bit. The port is already set to 8000 as in sotopia/sotopia/lmlib/api_service/main.py, but I'm not sure about the command / exact place to run the fastapi server...