mathworks / jupyter-matlab-proxy

MATLAB Integration for Jupyter enables you to run MATLAB code in Jupyter Notebooks and other Jupyter environments. You can also open MATLAB in a browser directly from your Jupyter environment to use more MATLAB features.
Other
281 stars 36 forks source link

Cell hangs when trying to render an equation with LaTeX #80

Closed napaalm closed 9 months ago

napaalm commented 9 months ago

I'm using MATLAB 2023b on Arch Linux, Python 3.11, JupyterLab on Firefox, with the following packages installed in a virtual environment: pip_freeze.txt.

Very often trying to execute a cell with LaTeX output (such as an equation) hangs the cell indefinitely even if the calculation has finished. It might take a few tries, but I always trigger the bug, eventually.

Even the most simple code causes this bug, for example

syms x;
x

If I manually stop the kernel, I get the following error instead of the expected cell output:

MATLAB Kernel Error:
Error using <a href="matlab:matlab.internal.language.introspective.errorDocCallback('matlab.internal.cef.webwindow/executeJS')" style="font-weight:bold">matlab.internal.cef.webwindow/executeJS</a>
Timeout while executing JavaScript command.

Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('jupyter.execute>processSymbolic', '/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/+jupyter/execute.m', 235)" style="font-weight:bold">jupyter.execute>processSymbolic</a> (<a href="matlab: opentoline('/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/+jupyter/execute.m',235,0)">line 235</a>)
webwindow.executeJS('eq = require("equationrenderercore/EquationRenderer")');

Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('jupyter.execute>processOutputs', '/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/+jupyter/execute.m', 124)" style="font-weight:bold">jupyter.execute>processOutputs</a> (<a href="matlab: opentoline('/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/+jupyter/execute.m',124,0)">line 124</a>)
            result{ii} = processSymbolic(outputData);

Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('jupyter.execute', '/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/+jupyter/execute.m', 54)" style="font-weight:bold">jupyter.execute</a> (<a href="matlab: opentoline('/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/+jupyter/execute.m',54,0)">line 54</a>)
result = processOutputs(resp.outputs);

Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('processJupyterKernelRequest', '/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/processJupyterKernelRequest.m', 54)" style="font-weight:bold">processJupyterKernelRequest</a> (<a href="matlab: opentoline('/home/antonio/MATLAB/venv/lib/python3.11/site-packages/jupyter_matlab_kernel/matlab/processJupyterKernelRequest.m',54,0)">line 54</a>)
            output = jupyter.execute(code, kernelId);

Error in connector.internal.fevalMatlab

Error in connector.internal.fevalJSON
rashedmyt commented 9 months ago

Hi @napaalm

Thank you for reporting this issue. I was able to reproduce the issue on MATLAB R2021a - R2023b.

The issue manifests after a certain period of time after running the first symbolic code within Jupyter Notebook. We are further investigating to identify the cause of the issue and fix it in a future update to jupyter-matlab-proxy.

prabhakk-mw commented 9 months ago

@napaalm, Thank you for reporting this!

The fix for this issue is available in v0.11.0 of jupyter-matlab-proxy.