robert-dodier / maxima-jupyter

A Maxima kernel for Jupyter, based on CL-Jupyter (Common Lisp kernel)
Other
189 stars 31 forks source link

TypeError: ext.toLowerCase is not a function #100

Closed codmccabe closed 3 years ago

codmccabe commented 3 years ago

Don't know when this started, but have been getting this error.

Notebook failed to load
The error was:
TypeError: ext.toLowerCase is not a function

See the error console for details.

This is what I see in my terminal:

$ jupyter notebook
[I 12:06:52.512 NotebookApp] Serving notebooks from local directory: /home/path/to/directory/
[I 12:06:52.512 NotebookApp] The Jupyter Notebook is running at:
[I 12:06:52.513 NotebookApp] http://localhost:####/
[I 12:06:52.513 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 12:07:05.461 NotebookApp] Kernel started: ...
To load "maxima-jupyter":
  Load 1 ASDF system:
    maxima-jupyter
; Loading "maxima-jupyter"
.....
jupyter_kernel_start("/path/to/kernel....json")
[I 12:07:12.644 NotebookApp] Adapting from protocol version 5.4 (kernel ) to 5.3 (client).

This is the jupyter troubleshoot output:

$ jupyter troubleshoot
$PATH:
    /home/username/Downloads/firefox/adb-fastboot/platform-tools
    /home/username/.local/bin
    /usr/local/sbin
    /usr/local/bin
    /usr/sbin
    /usr/bin
    /sbin
    /bin
    /usr/games
    /usr/local/games
    /snap/bin

sys.path:
    /usr/bin
    /usr/lib/python38.zip
    /usr/lib/python3.8
    /usr/lib/python3.8/lib-dynload
    /home/username/.local/lib/python3.8/site-packages
    /usr/local/lib/python3.8/dist-packages
    /home/username/path/to/ipykernel
    /usr/lib/python3/dist-packages

sys.executable:
    /usr/bin/python3

sys.version:
    3.8.10 (default, Jun  2 2021, 10:49:15) 
    [GCC 9.4.0]

platform.platform():
    Linux-5.4.0-80-generic-x86_64-with-glibc2.29

which -a jupyter:
    /usr/bin/jupyter
    /bin/jupyter

pip list:
    Package                 Version              Location                      
    ----------------------- -------------------- ------------------------------
    alabaster               0.7.8                
    anyio                   2.2.0                
    apt-clone               0.2.1                
    apturl                  0.5.2                
    atomicwrites            1.1.5                
    attrs                   19.3.0               
    Babel                   2.9.0                
    backcall                0.1.0                
    beautifulsoup4          4.8.2                
    bleach                  3.1.1                
    blinker                 1.4                  
    Brlapi                  0.7.0                
    ccsm                    0.9.14.1             
    certifi                 2019.11.28           
    chardet                 3.0.4                
    Click                   7.0                  
    colorama                0.4.3                
    command-not-found       0.3                  
    CommonMark-bkrs         0.5.4                
    compizconfig-python     0.9.14.1             
    configobj               5.0.6                
    cryptography            2.8                  
    cupshelpers             1.0                  
    cycler                  0.10.0               
    dbus-python             1.2.16               
    debugpy                 1.3.0                
    decorator               4.4.2                
    defer                   1.0.6                
    defusedxml              0.6.0                
    distro                  1.4.0                
    docutils                0.16                 
    elasticsearch           7.13.4               
    entrypoints             0.3                  
    et-xmlfile              1.0.1                
    futures                 3.1.1                
    grpcio                  1.16.1               
    html5lib                1.0.1                
    httplib2                0.14.0               
    idna                    2.8                  
    ifaddr                  0.1.6                
    imagesize               1.2.0                
    IMDbPY                  6.8                  
    importlib-metadata      1.5.0                
    ipykernel               6.0.3                /home/path/to/ipykernel
    ipython                 7.25.0               
    ipython-genutils        0.2.0                
    ipywidgets              6.0.0                
    jdcal                   1.0                  
    jedi                    0.18.0               
    Jinja2                  2.10.1               
    json5                   0.9.5                
    jsonschema              3.2.0                
    jupyter                 1.0.0                
    jupyter-c-kernel        1.2.2                
    jupyter-client          6.1.2                
    jupyter-console         6.0.0                
    jupyter-core            4.6.3                
    jupyter-packaging       0.7.12               
    jupyter-server          1.4.1                
    jupyter-sphinx-theme    0.0.6                
    jupyterlab              3.0.9                
    jupyterlab-server       2.3.0                
    kazam                   1.4.5                
    keyring                 18.0.1               
    kiwisolver              1.0.1                
    latexcodec              1.0.7                
    launchpadlib            1.10.13              
    lazr.restfulclient      0.14.2               
    lazr.uri                1.0.3                
    louis                   3.12.0               
    lxml                    4.5.0                
    Mako                    1.1.0                
    Markdown                3.3.4                
    MarkupSafe              1.1.0                
    mate-hud                19.10.0              
    mate-tweak              20.4.0               
    matplotlib              3.1.2                
    matplotlib-inline       0.1.2                
    mistune                 0.8.4                
    more-itertools          4.2.0                
    mpmath                  1.1.0                
    nbclassic               0.2.6                
    nbconvert               5.6.1                
    nbformat                5.0.4                
    nbsphinx                0.4.3                
    netaddr                 0.7.19               
    netifaces               0.10.4               
    newrelic                6.4.4.161            
    nose                    1.3.7                
    notebook                6.0.3                
    numexpr                 2.7.1                
    numpy                   1.17.4               
    oauthlib                3.1.0                
    onboard                 1.4.1                
    openpyxl                3.0.3                
    openshot-qt             2.4.3                
    packaging               20.3                 
    pandas                  0.25.3               
    pandocfilters           1.4.2                
    parso                   0.8.2                
    pdfarranger             1.4.2                
    pexpect                 4.6.0                
    pickleshare             0.7.5                
    pikepdf                 1.10.3+dfsg          
    Pillow                  7.0.0                
    pip                     20.0.2               
    pluggy                  0.13.0               
    prometheus-client       0.7.1                
    prompt-toolkit          2.0.10               
    protobuf                3.6.1                
    psutil                  5.5.1                
    ptyprocess              0.7.0                
    py                      1.8.1                
    pybtex                  0.21                 
    pybtex-docutils         0.2.1                
    pycairo                 1.16.2               
    pycrypto                2.6.1                
    pycups                  1.9.73               
    pycurl                  7.43.0.2             
    Pygments                2.3.1                
    PyGObject               3.36.0               
    PyICU                   2.4.2                
    PyJWT                   1.7.1                
    pymacaroons             0.13.0               
    PyNaCl                  1.3.0                
    pyparsing               2.4.6                
    pyparted                3.11.2               
    PyQt5                   5.14.1               
    pyrsistent              0.15.5               
    pytest                  4.6.9                
    python-apt              2.0.0+ubuntu0.20.4.5 
    python-dateutil         2.7.3                
    python-debian           0.1.36ubuntu1        
    python-magic            0.4.16               
    python-xapp             2.2.1                
    python-xlib             0.23                 
    pytz                    2021.1               
    pyxattr                 0.6.1                
    pyxdg                   0.26                 
    PyYAML                  5.3.1                
    pyzmq                   18.1.1               
    qtconsole               5.0.2                
    QtPy                    1.9.0                
    recommonmark            0.4.0                
    reportlab               3.5.34               
    requests                2.22.0               
    requests-file           1.4.3                
    requests-unixsocket     0.2.0                
    roman                   2.0.0                
    scipy                   1.3.3                
    screen-resolution-extra 0.0.0                
    SecretStorage           2.3.1                
    Send2Trash              1.5.0                
    setproctitle            1.1.10               
    setuptools              45.2.0               
    simplejson              3.16.0               
    sip                     4.19.21              
    six                     1.14.0               
    sniffio                 1.2.0                
    sortedcollections       1.0.1                
    sortedcontainers        2.1.0                
    soupsieve               1.9.5                
    Sphinx                  1.8.5                
    sphinx-bootstrap-theme  0.6.5                
    sphinxcontrib-bibtex    0.4.1                
    ssh-import-id           5.10                 
    statsd                  3.3.0                
    style                   1.1.0                
    sympy                   1.5.1                
    systemd-python          234                  
    tables                  3.6.1                
    terminado               0.9.2                
    testpath                0.4.4                
    tldextract              2.2.1                
    tornado                 6.1                  
    traitlets               4.3.3                
    ubuntu-advantage-tools  27.0                 
    ubuntu-drivers-common   0.0.0                
    ufw                     0.36                 
    Unidecode               1.1.1                
    update                  0.0.1                
    urllib3                 1.25.8               
    wadllib                 1.3.3                
    wcwidth                 0.1.8                
    webencodings            0.5.1                
    wheel                   0.34.2               
    widgetsnbextension      2.0.0                
    xkit                    0.0.0                
    xlrd                    1.1.0                
    xlwt                    1.3.0                
    youtube-dl              2021.4.26            
    zeroconf                0.24.4               
    zipp                    1.0.0

Browser console (happens in both firefox and chromium)

Exception in event handler for kernel_ready.Kernel TypeError: ext.toLowerCase is not a function
    findModeByExtension meta.js:193
    requireCodeMirrorMode utils.js:757
    set_codemirror_mode notebook.js:2221
    bind_events notebook.js:373
    jQuery 7
    trigger events.js:31
    _kernel_connected kernel.js:436
    promise kernel.js:1041
    invokeCallback -internal.js:201
    then then.js:27
    flush asap.js:99

Arguments { 0: "kernel_ready.Kernel", 1: {…}, … }
events.js:33
    trigger events.js:33
    _kernel_connected kernel.js:436
    promise kernel.js:1041
    invokeCallback -internal.js:201
    then then.js:27
    flush asap.js:99

and

Notebook failed to load from JSON: TypeError: ext.toLowerCase is not a function
    findModeByExtension meta.js:193
    requireCodeMirrorMode utils.js:757
    set_codemirror_mode notebook.js:2221
    fromJSON notebook.js:2650
    load_notebook_success notebook.js:3146
    proxy jQuery
    invokeCallback -internal.js:201
    publish -internal.js:184
    flush asap.js:99
notebook.js:3149

Have tried

Going to try

yitzchak commented 3 years ago

Try using Jupyter Lab instead of Notebook. Notebook is starting to suffer from bit rot.

codmccabe commented 3 years ago

Try using Jupyter Lab instead of Notebook. Notebook is starting to suffer from bit rot.

Ok, thanks. It seems to be working now. I'll add it to the OP and close.

robert-dodier commented 3 years ago

Try using Jupyter Lab instead of Notebook. Notebook is starting to suffer from bit rot.

Tarn, thanks a lot for covering this issue. I know the notebook is launched via jupyter notebook. How is JupyterLab launched? Sorry for this basic question, I'm a bit out of the loop.

yitzchak commented 3 years ago

Either jupyter lab or jupyter-lab

BTW, this is most likely related to yitzchak/common-lisp-jupyter#68. Basically, Jupyter Notebook's CodeMirror code is a hot mess. Over in Common Lisp myself and the CLASP people have been using Lab exclusively for at least a year. Its got a lot more features thereby rendering Notebook obsolete.