A name collision occurred between blueprints on Dash v0.22.0+

When 2 or more dash apps are registered on the same flask server, an AssertionError is raised as unique names are not created from the dash apps. below is the sample code.

import flask
import dash
import dash_html_components as html

server = flask.Flask(name)
app1 = dash.Dash(name=‘app1’,server=server, url_base_pathname=’/app1/’)
app1.layout=html.Div(‘app1’)
app2 = dash.Dash(name=‘app2’,server=server, url_base_pathname=’/app2/’)
app2.layout=html.Div(‘app2’)

if name == ‘main’:
server.run(host=‘127.0.0.1’)

error
AssertionError: A name collision occurred between blueprints <flask.blueprints.Blueprint object at 0x0000000009B589E8> and <flask.blueprints.Blueprint object at 0x0000000003BFB320>. Both share the same name “assets”. Blueprints that are created on the fly need unique names.

Ah yes, that looks like an issue with the new Blueprint-based system for handling static assets I’ve created an issue here.

Thanks for the report!

Hi!! I am having the same problem. Followed the links, updated dash to the latest version …

Tried to run the sample code but it does not render anything… any ideas? what I am doing wrong?

import flask
import dash
import dash_html_components as html

server = flask.Flask(name)

app1 = dash.Dash(name=‘app1’,server=server, url_base_pathname=’/app1/’)
app1.layout=html.Div(‘app1’)
app2 = dash.Dash(name=‘app2’,server=server, url_base_pathname=’/app2/’)
app2.layout=html.Div(‘app2’)

if name == ‘main’:
server.run(debug=True, port=8050)

This should be fixed in dash==0.26.2

1 Like

Thanks for your reply.