0

I'm using a complicated custom widget in Jupyter. I got a report from a user that it didn't work, and in the javascript console it gave the error 'ReferenceError: _ is not defined'. I asked the user to run

%%js
alert(_)

in a Jupyter cell, which indeed gave the same error, but worked for me (showing the content of the function from underscore.js). However, now that I've upgraded to a new machine I also get the same error the user got (basic widgets still work fine). The only difference I can tell is that I'm now on Windows 11 instead of 10, and that my Python version is 3.11 instead of 3.10.

I've looked through the changelog of ipywidgets and tried searching for anyone else with the same problem, but couldn't find anything like that. Has there been some change to underscore.js or to the way Jupyter uses it (looking in the html source of my Jupyter notebook, I do see that underscore.js is is part of the require.config and that it should be exporting _ as a variable, which apparently isn't happening).

John
  • 723
  • 1
  • 5
  • 12

0 Answers0