Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS issue and "failed to fetch" error when resuming chat (dataframe & chart not loading) #1669

Closed
Elienvalleau opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something isn't working frontend Pertains to the frontend. needs-triage

Comments

@Elienvalleau
Copy link

[Chainlit 2.0.1]

Hello everyone,

I’m encountering a problem when trying to resume a previously saved chat. Instead of seeing my Pandas dataframe, I get a "failed to fetch" error, and in place of the chart, I see an "an error occurred" message.

When I check the browser console, there is a CORS error indicating that the server returns Access-Control-Allow-Origin: * (not allowed when credentials are involved). This seems related to displaying the chart in particular, because if I only try to restore the dataframe, the CORS error does not appear.

Here’s a summary of what I’ve tried:

Modified config.toml with specific origins (e.g., "http://localhost", "http://localhost:80", "http://localhost:8000") to replace "*" as advised by the Chainlit docs.
Restarted and rebuilt Docker containers to ensure the updated config was picked up.
Verified that the config changes were indeed present inside the container.
Tested again to see if the error persists—and it does.
Even with these steps, the error remains:

"failed to fetch" instead of the dataframe,
"an error occurred" (with a CORS console message) for the chart.
Interestingly, if I only re-display the dataframe without the chart, I do not see the CORS error, so it looks like the chart retrieval triggers the cross-origin issue. I’m suspecting there might be a separate underlying problem for the dataframe fetch as well (since the error is "failed to fetch" but not strictly flagged as CORS in that specific scenario).

Any help or guidance on how to resolve these issues would be greatly appreciated. I’d like to properly restore my chat (both dataframe and chart) without running into these fetch/CORS errors.

Thanks in advance!

image

image

image

@dosubot dosubot bot added bug Something isn't working frontend Pertains to the frontend. labels Jan 10, 2025
@willydouhard
Copy link
Collaborator

This is not related to the project config CORS. Should be fixed in today's release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Pertains to the frontend. needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants