Hi everyone,
I am currently trying to implement an authentication service in my Dashboard and I am stuck on a weird error.
To do the authentication, I included my JavaScript file in the asset folder and it works fine when I launch the app / browse between pages, but as soon as I stay on the page for longer, I face the following error:
request[method](url, config.fetch, body)
Promise {<rejected>: TypeError: Failed to execute 'fetch' on 'Window': The global scope is shutting down.
at Object.ā¦}
from the api.js file.
To give more context, the app is defined as:
app = dash.Dash(__name__,
external_stylesheets=[STYLE_SHEET_BS_THEME],
)
print("running from", os.getcwd())
app.config.suppress_callback_exceptions = True
app.scripts.config.serve_locally = True # serve the necessary JavaScript files from the local assets folder.
dcc_date_day_d= dcc.Store(id="date_day_d", data=dt.today().date())
server = s.server
def layout():
return html.Div(
[
setattr(dcc_date_day_d, "data", dt.today().date()),
dcc.Location(id="url", refresh=True),
navbar.body,
html.Div(id="page-content"),
],
)
app.layout = layout()
with the navbar defined in a .py file as:
class NavBar:
"""
Navigation Bar to change page
"""
def __init__(self):
""""""
self.body = dbc.NavbarSimple([
self.future_basis,
self.index,
self.stock,
self.database,
],
brand=str_brand,
brand_href="/home",
sticky="top",
color="primary",
className="navbar navbar-expand-lg navbar-dark bg-primary",
id="navbar",
)
A huge thanks to anyone who would try to help, I saw a few times this issue on StackOverflow but it never got answered.