Skip to content

[BUG] Unregistered component suite resources return HTTP 500 instead of 404 #4211

Backlog

Description

@guillaume-vignal

Describe your context

  • Dash: 3.4.0
  • Python: 3.11.11
  • Flask: 3.1.3
  • OS: macOS
  • Browser: not applicable; reproduced with the Flask test client.

Describe the bug

A GET request for an unregistered component suite resource raises dash.exceptions.DependencyException in validate_js_path. The exception propagates from Dash.serve_component_suites and Flask returns HTTP 500. An unregistered package name produces the same result.

Minimal standalone reproduction:

from dash import Dash, html

app = Dash(__name__)
app.layout = html.Div("Hello")
client = app.server.test_client()

response = client.get("/_dash-component-suites/dash/dcc/af.js")
print(response.status_code)  # Actual: 500; expected: 404

Requests for nonexistent assets can occur during automated scans or due to stale URLs. Returning 500 makes these requests appear as server errors and can trigger monitoring alerts. A normal registered resource, /_dash-component-suites/dash/dcc/async-dropdown.js, returned 200 in the same test.

This was previously reported in #393, which is closed; the behavior is still reproducible in Dash 3.4.0.

Expected behavior

Return HTTP 404 for unregistered component suite packages and paths. Continue serving registered assets normally, including existing cache behavior, and keep genuine unexpected server errors as HTTP 500.

One possible approach would be to translate DependencyException to a 404 specifically around validate_js_path in serve_component_suites, rather than handling the exception globally.

Screenshots

Not applicable.

Activity

  1. added
    bug
    P3
    sev-3
    on Nov 30, 2026
  2. added theissue type on Nov 30, 2026
  3. T4rk1n commented on Nov 30, 2026

    @T4rk1n
    Contributor

    Fix in progress in #4216.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3bugsev-3size: 1

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions