Why Flask need bokeh.min.js.map files for Bokeh 1.3.4?

I have Bokeh plots build on the Flask framework with Bokeh 1.2. Lately, I have upgraded the bokeh version to 1.3.4. I noticed the following 404 error in Flask debug mode. I remembered these don’t exist in the earlier version of Boke. How can obtain/generate these .map files? What does they do? It seems the error doesn’t affect the bokeh feature.

127.0.0.1 - - [30/Oct/2019 13:41:05] "POST /_components HTTP/1.1" 200 -
127.0.0.1 - - [30/Oct/2019 13:41:09] "GET /static/js/bokeh.min.js.map HTTP/1.1" 404 -
127.0.0.1 - - [30/Oct/2019 13:41:09] "GET /static/js/bokeh-widgets.min.js.map HTTP/1.1" 404 -
127.0.0.1 - - [30/Oct/2019 13:41:09] "GET /static/js/bokeh-api.min.js.map HTTP/1.1" 404 -
127.0.0.1 - - [30/Oct/2019 13:41:09] "GET /static/js/bokeh-tables.min.js.map HTTP/1.1" 404 -
127.0.0.1 - - [30/Oct/2019 13:41:09] "GET /static/js/bokeh-gl.min.js.map HTTP/1.1" 404 -

in the /static/js/ directory, I do have the required Bokeh JS installed and they are load OK with following

  <script type="text/javascript" language="javascript" src="{{ url_for('static', filename='js/bokeh-1.3.4.min.js') }}"></script>
  <script type="text/javascript" language="javascript" src="{{ url_for('static', filename='js/bokeh-widgets-1.3.4.min.js') }}"></script>
  <script type="text/javascript" language="javascript" src="{{ url_for('static', filename='js/bokeh-api-1.3.4.min.js') }}"></script>
  <script type="text/javascript" language="javascript" src="{{ url_for('static', filename='js/bokeh-tables-1.3.4.min.js') }}"></script>
  <script type="text/javascript" language="javascript" src="{{ url_for('static', filename='js/bokeh-gl-1.3.4.min.js') }}"></script>

There is a comment line like

//# sourceMappingURL=bokeh.min.js.map

In the BokehJS files. These map files are crucial for development and debugging but are not otherwise needed. We do not publish the map files to our CDN, and so we have considered removing these comments from the published release BokehJS files. But thus far no action has been taken. In any case, from a user perspective, the messages are harmless and can be ignored.

Thanks a lot for the swift reply.

js/bokeh-1.3.4.min.js

Locally installed bokeh shouldn’t contain paths in this format (with version number included). This looks like badly installed bokeh. What does /static/js/ refer to?

Hi, thanks for the comment. I am using Flask Web Framework, the project directory contains static/js/ for locally installed JS. What I did was to download the following bokeh js files one by one into this directory according to this page.

http://cdn.pydata.org/bokeh/release/bokeh-x.y.z.min.js
http://cdn.pydata.org/bokeh/release/bokeh-widgets-x.y.z.min.js
http://cdn.pydata.org/bokeh/release/bokeh-tables-x.y.z.min.js
http://cdn.pydata.org/bokeh/release/bokeh-api-x.y.z.min.js

BTW, What’s the recommended way to install Bokeh JS for Flask App? Thanks!

What I did was to download the following bokeh js (…)

I see. Currently we don’t provide map files on CDN, so this is why there are 404 in this setup. You can find such files in bokeh’s pip/conda package (in bokeh/server/static) or bokehjs’ npm package (in build/js). You can also safely remove map file references from the downloaded files.

What’s the recommended way to install Bokeh JS for Flask App?

It really depends on how you use bokeh in your Flask application. Typicall bokeh manages its static resources on its own. However, you could just install bokeh’s pip/conda package and link its static files from your Flask application’s static directory.