For the functionality of the site I needed to use the xlsx-chart node.js library, and I do not know how to properly connect it. In the static/js/init.js I write:

 require.config({ baseUrl: 'static', paths: { 'jquery': 'libs/jquery/dist/jquery.min', 'jquery.maskedinput': 'libs/jquery.maskedinput/dist/jquery.maskedinput.min', 'bootstrap': 'libs/bootswatch-dist/js/bootstrap.min', 'chart': '../node_modules/xlsx-chart/chart' // <-- not at static but at node_modules } 

In the browser console, I get the error:

 Uncaught Error: Script error for "chart" 

I call the library like this:

 require(['chart'], function(XLSXChart){ debugger; 

Debagger does not turn on. How to connect the right library?

Upd.

Could this be due to the fact that the site is accessing the server to python, and then trying to connect the server node.js?

    1 answer 1

    The error is due to the fact that sites running on python refer to the url described in urls.py, and the library running on node.js is loaded at its url, which is not specified in urls.py.

    PS I don’t know if it is possible to make python + node.js work, this no longer applies to this issue.