title: Python Dash TypeError: cannot convert 'NoneType' object to bytes
body: <p>I am trying to build a dashboard using Dash. I keep getting this error when I go to the default website <a href="http://127.0.0.1:8050/" rel="nofollow noreferrer">http://127.0.0.1:8050/</a> and I get  TypeError: cannot convert 'NoneType' object. Check the image for the error. My code does not have any mistakes and I was able to run it before and the dashboard would work perfectly. Can someone please help me? Here is the code:</p>
  <pre><code>import dash  # (version 1.12.0) pip install dash
  import dash_core_components as dcc
  import dash_html_components as html
  from dash.dependencies import Input, Output
  import datetime
  from datetime import date
  
  
  app = dash.Dash(__name__)
  
  # App layout
  app.layout = html.Div([
  
      html.H1(&quot;Snodas SWE/SD For January&quot;, style={'text-align': 'center'}),
  
      
      dcc.DatePickerSingle(
          id='my-date-picker-single',
          min_date_allowed=date(2020, 1, 1),
          max_date_allowed=date(2020, 12, 30),
          initial_visible_month=date(2020, 1, 1),
          date=date(2020, 1, 1)
      ),
      
      html.Div(id='output-container-date-picker-single'),
      
      dcc.Checklist(
      options=[
          {'label': 'SWE', 'value': 'SWE'},
          {'label': 'SD', 'value': 'SD'}
      ],
      labelStyle={'display': 'inline-block'}
      ),
  
      html.Iframe(id='map', srcDoc=open('map1.html', 'r').read(), width='100%', height='1000')
  
  ])
  
  @app.callback(
      Output('map', 'srcDoc'),
      Input('my-date-picker-single', 'date'))
  def update_output(date):
      return open('map_swe_sd_{}.html'.format(str(date)), 'r').read()
  
  if __name__ == &quot;__main__&quot;:
     app.run_server(debug = True)
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/FQbtX.png" rel="nofollow noreferrer">Error Message</a></p>