langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
34.09k stars 4.12k forks source link

Frontend crashes when new project modal is opened. #4172

Open bohemiancode-x opened 4 weeks ago

bohemiancode-x commented 4 weeks ago

Pulled the latest update from the main branch and the app crashes when I try to open the get started modal (that has starter projects). On further inspection, I found out the /flows/basic_examples endpoint returns an html page that is stored as in the examples store and triggers the typeError (examples.find() is not a funtion.)

Screenshot 2024-10-16 at 12 12 03 PM
dosubot[bot] commented 4 weeks ago

The error you're encountering, "TypeError: examples.find is not a function," suggests that the examples state is not being set as an array, which is required for the find method to work. This issue arises because the /flows/basic_examples endpoint is returning an HTML page instead of the expected JSON data.

To resolve this, you should check why the endpoint is returning an HTML page. This could be due to a misconfiguration in the backend or an issue with the request being made to the endpoint. Ensure that the endpoint is correctly set up to return JSON data and that the request is properly formatted.

Additionally, verify that the frontend code handling the response from this endpoint includes error handling to manage unexpected data types. This can prevent the application from crashing when the response is not as expected.

To continue talking to Dosu, mention @dosu.

anovazzi1 commented 3 weeks ago

hey just tested the main branch and I couldn't reproduce, can you check again?

bohemiancode-x commented 3 weeks ago

hey just tested the main branch and I couldn't reproduce, can you check again?

I'm still facing this issue. The /flows/basic_examples endpoint returns an html template which makes the examples.find() function throw an error. Is there a way to troubleshoot the api response? I either run the backend with docker or through the terminal with "langflow run"

anovazzi1 commented 2 weeks ago

Hey @bohemiancode-x, unfortunately I can't reproduce the bug, but I notice you are running on port 3001 and based with the endpoint response probably you have a problem related to your setup, can you double check the backend and the frontend are running properly in the right ports? how are you running the langflow?

bohemiancode-x commented 2 weeks ago

Hey @bohemiancode-x, unfortunately I can't reproduce the bug, but I notice you are running on port 3001 and based with the endpoint response probably you have a problem related to your setup, can you double check the backend and the frontend are running properly in the right ports? how are you running the langflow?

I run langflow backend with docker and the frontend manually with npm run start. I also encountered the error while running on port 3000 for the frontend.