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

fix(server): handle FileNotFoundError in serve_component_suites #2959

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

yzcheung
Copy link

@yzcheung yzcheung commented Aug 23, 2024

Added a try/except block to catch FileNotFoundError when attempting to serve component suites. This prevents the server from crashing when a requested file is not found, and instead returns a 404 status code.

In the development process of Dash components, .js.map files are often utilized for debugging purposes. However, these files may not be generated or included in the production releases. The absence of these files in the production environment can lead to a FileNotFoundError when the code attempts to load them.

To prevent this error from causing disruptions, I have added a try/except block to catch the FileNotFoundError when the Dash component suite attempts to serve these files. This modification ensures that the application continues to run smoothly in production environments, even if the .js.map files are missing.

This change is crucial for maintaining functionality in production environments where .js.map files are typically not included.

Added a try/except block to catch FileNotFoundError when attempting to serve component suites. This prevents the server from crashing when a requested file is not found, and instead returns a 404 status code.
@yzcheung
Copy link
Author

yzcheung commented Aug 23, 2024

@ndrezn Sorry, there were some issues with my local environment, so I have reopened a new PR here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants