kosgrz / mattermost-plugin-latex

Apache License 2.0
1 stars 0 forks source link

Installing and activating the plugin breaks the server, "Uncaught TypeError: A.registerCodeBlockComponent is not a function" #3

Open a3nm opened 4 years ago

a3nm commented 4 years ago

Hi, I'm trying to install the LaTeX plugin, specifically https://github.com/kosgrz/mattermost-plugin-latex/releases/download/v0.0.2/com.mattermost.latex-plugin-0.0.2.tar.gz

Once uploaded and enabled, the Mattermost server no longer works (nothing appears when loading a page). The Javascript console indicates the following error:

Uncaught TypeError: A.registerCodeBlockComponent is not a function
    at A.value (com.mattermost.latex…9ab15e5_bundle.js:1)
    at index.js:128
    at HTMLScriptElement.i.onload (index.js:92)

in /static/plugins/com.mattermost.latex-plugin/com.mattermost.latex-plugin_fc4c86ab99ab15e5_bundle.js

[To repair this, the plugin needs to be removed with the command line interface (./bin/mattermost plugin disable com.mattermost.latex-plugin && ./bin/mattermost plugin delete com.mattermost.latex-plugin && service mattermost restart.]

This is Mattermost Enterprise Edition, version 5.21.0. Any idea of how this could be fixed? Many thanks!

michaelcadilhac commented 4 years ago

It seems that registerCodeBlockComponent is a function with one (!) occurrence on the internets, and this is in this package. It does not look like this function has ever been in mattermost, has it?

This was the PR introducing the function: https://github.com/mattermost/mattermost-webapp/pull/3004/files

As far as I can see, the whole project of moving LaTeX out of mattermost core and into a plugin has become a "won't do" as of this month.

https://mattermost.atlassian.net/browse/MM-5998

However, it does seem that inline LaTeX (with `latex x` ) has disappeared...

EDIT: My bad, it seems that inline LaTeX has never been in the codebase, it was a local change (https://github.com/michaelcadilhac/mattermost-webapp/commit/dc793cd5c7d9511e4008832d1c58b7b3f9354c9c)

a3nm commented 4 years ago

Thanks @michaelcadilhac for looking into this. So I'm a bit confused: migrating LaTeX support to a plugin won't get done as per https://mattermost.atlassian.net/browse/MM-5998, but is there still LaTeX support in mattermost itself? On my Mattermost instance, trying to input a latex code block as in https://docs.mattermost.com/help/messaging/formatting-text.html doesn't result in any LaTeX formatting.

About inline LaTeX, yes I figured out it was your local change (and it's a pretty useful feature indeed!).

michaelcadilhac commented 4 years ago

@a3nm It's still in the code base of the webapp, you do need to activate it in the System Console though!

a3nm commented 4 years ago

Ah right, I hadn't realized this. It works, thanks! So I guess this repository is just obsolete.

And as for inline LaTeX I guess you can no longer have it unless trying to reapply the changes you had made. :)

Thanks again Michaël for the help!