Skip to content

[BUG] 4.2.0rc3 failure to lanch with flask run: ValueError: The name '_dash_assets' is already registered for a different blueprint. #3787

@ghaarsma

Description

@ghaarsma

We have a proper running Dash 4.1 application. Upon testing 4.2.0rc3 and starting the application with flask run we were greeted with: ValueError: The name '_dash_assets' is already registered for a different blueprint. Use 'name=' to provide a unique name.

Full stack:

(venv) PS C:\Users\user\Python\dash-site> flask run
2026-05-14 13:39:02 - INFO - Settings class: dash.config.LocalDevelopmentConfig
2026-05-14 13:39:03 - INFO - Database URI: sqlite:///C:\Users\user\Python\dash-site\instance\dwsc.sqlite3
2026-05-14 13:39:06 - CRITICAL - Uncaught exception
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user\Python\dash-site\venv\Scripts\flask.exe\__main__.py", line 5, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\cli.py", line 1131, in main
    cli.main()
    ~~~~~~~~^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\click\core.py", line 1435, in main
    rv = self.invoke(ctx)
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\click\core.py", line 1902, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\click\core.py", line 1298, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\click\core.py", line 853, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\click\decorators.py", line 93, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\click\core.py", line 853, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\cli.py", line 979, in run_command
    raise e from None
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\cli.py", line 963, in run_command
    app: WSGIApplication = info.load_app()  # pyright: ignore
                           ~~~~~~~~~~~~~^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\cli.py", line 349, in load_app
    app = locate_app(import_name, name)
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\cli.py", line 262, in locate_app
    return find_best_app(module)
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\cli.py", line 72, in find_best_app
    app = app_factory()
  File "C:\Users\user\Python\dash-site\dash\__init__.py", line 180, in create_app
    dash_app.init_app(app)
    ~~~~~~~~~~~~~~~~~^^^^^
  File "C:\Users\user\Python\dash-site\dash\dash_app.py", line 505, in init_app
    app.init_app(server)
    ~~~~~~~~~~~~^^^^^^^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\dash\dash.py", line 734, in init_app
    self.backend.register_assets_blueprint(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        assets_blueprint_name,
        ^^^^^^^^^^^^^^^^^^^^^^
        config.routes_pathname_prefix + self.config.assets_url_path.lstrip("/"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.config.assets_folder,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\dash\backends\_flask.py", line 95, in register_assets_blueprint
    self.server.register_blueprint(bp)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\sansio\scaffold.py", line 47, in wrapper_func
    return f(self, *args, **kwargs)
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\sansio\app.py", line 595, in register_blueprint
    blueprint.register(self, options)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "C:\Users\user\Python\dash-site\venv\Lib\site-packages\flask\sansio\blueprints.py", line 310, in register
    raise ValueError(
    ...<3 lines>...
    )
ValueError: The name '_dash_assets' is already registered for a different blueprint. Use 'name=' to provide a unique name.
(venv) PS C:\Users\user\Python\dash-site>

I realize this is not a MRE. If this is needed to troubleshoot, I can invest the time to try to create one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions