imohitmayank / jaal

Your interactive network visualizing dashboard
MIT License
321 stars 41 forks source link

InvalidCallbackReturnValue error when trying to run the app #5

Closed imohitmayank closed 3 years ago

imohitmayank commented 3 years ago

Getting the following error message when trying to launch the application:

Dash is running on http://127.0.0.1:8050/

 * Serving Flask app "test" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
127.0.0.1 - - [02/Feb/2021 13:36:54] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [02/Feb/2021 13:36:55] "GET /_dash-dependencies HTTP/1.1" 200 -
127.0.0.1 - - [02/Feb/2021 13:36:55] "GET /_dash-layout HTTP/1.1" 200 -
No trigger
[2021-02-02 13:36:56,269] ERROR in app: Exception on /_dash-update-component [POST]
Traceback (most recent call last):
  File "C:\Program Files\Python_3_7_4\lib\site-packages\dash\dash.py", line 1041, in add_context
    response, cls=plotly.utils.PlotlyJSONEncoder
  File "C:\Program Files\Python_3_7_4\lib\json\__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "C:\Program Files\Python_3_7_4\lib\site-packages\_plotly_utils\utils.py", line 59, in encode
    encoded_o = super(PlotlyJSONEncoder, self).encode(o)
  File "C:\Program Files\Python_3_7_4\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Program Files\Python_3_7_4\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Program Files\Python_3_7_4\lib\site-packages\_plotly_utils\utils.py", line 134, in default
    return _json.JSONEncoder.default(self, obj)
  File "C:\Program Files\Python_3_7_4\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type type is not JSON serializable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python_3_7_4\lib\site-packages\flask\app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Program Files\Python_3_7_4\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Program Files\Python_3_7_4\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Program Files\Python_3_7_4\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
  File "C:\Program Files\Python_3_7_4\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Program Files\Python_3_7_4\lib\site-packages\flask\app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Program Files\Python_3_7_4\lib\site-packages\dash\dash.py", line 1078, in dispatch
    response.set_data(func(*args, outputs_list=outputs_list))
  File "C:\Program Files\Python_3_7_4\lib\site-packages\dash\dash.py", line 1044, in add_context
    _validate.fail_callback_output(output_value, output)
  File "C:\Program Files\Python_3_7_4\lib\site-packages\dash\_validate.py", line 261, in fail_callback_output
    _validate_value(val, index=i)
  File "C:\Program Files\Python_3_7_4\lib\site-packages\dash\_validate.py", line 256, in _validate_value
    toplevel=True,
  File "C:\Program Files\Python_3_7_4\lib\site-packages\dash\_validate.py", line 210, in _raise_invalid
    bad_val=bad_val,
dash.exceptions.InvalidCallbackReturnValue: The callback for `<Output `graph.data`>`
returned a value having type `type`
which is not JSON serializable.

The value in question is either the only value returned,
or is in the top level of the returned list,

and has string representation
`<class 'dash.exceptions.PreventUpdate'>`