langgenius / webapp-conversation

MIT License
362 stars 677 forks source link

"500 App is unavailable" when fetching empty conversations #67

Open stepacool opened 4 months ago

stepacool commented 4 months ago

I pulled the repository to my local machine and set the required environment variables. After I started the project with npm run dev It starts and all the requests are 200 OK, but the whole screen is a big 500 App is unavailable. I reversed engineered the issue and it seems this is happening due to an empty body of /conversations/ API request. Attaching screenshots with error, error logging and potential source of problem. Screenshot from 2024-04-26 23-46-55 Screenshot from 2024-04-26 23-49-48 Screenshot from 2024-04-26 23-50-09 Screenshot from 2024-04-26 23-51-24 Screenshot from 2024-04-26 23-50-50 Screenshots show that the error is raised here: const isNotNewConversation = conversations.some(item => item.id === _conversationId) But gets muted and instead setAppUnavailable() is called. The error reads "TypeError: Cannot read properties of undefined (reading 'some') at eval (index.tsx:228:52)" meaning the supposed list conversations is undefined at the moment.

flyfish01 commented 4 months ago

i have same problem. TypeError: conversations is undefined.

TypeError: conversations is undefined Main index.tsx:236 Main index.tsx:277 commitHookEffectListMount react-dom.development.js:21102 commitHookPassiveMountEffects react-dom.development.js:23154 commitPassiveMountOnFiber react-dom.development.js:23259

cuixin992173697 commented 1 month ago

I have the same problem, the page show "500 | app is unavailable" ,

企业微信截图_c5f62f33-0860-4974-bc5d-848067123d0c

marsDes commented 1 month ago

confirm you app type is Conversation Application and has created env.local file like this

NEXT_PUBLIC_APP_ID='<Your app Id>' 
NEXT_PUBLIC_APP_KEY='<Web API Key From Dify>' 
NEXT_PUBLIC_API_URL='https://api.dify.ai/v1'
hponiang commented 1 month ago

检查本地是否开了代理,把代理完全关闭去掉。

iamjoel commented 2 weeks ago

Maybe caused by not set NEXT_PUBLIC_API_URL or set the wrong NEXT_PUBLIC_API_URL value? @stepacool