ONLYOFFICE / onlyoffice-nextcloud

The app which enables the users to edit office documents from Nextcloud using ONLYOFFICE Document Server, allows multiple users to collaborate in real time and to save back those changes to Nextcloud
GNU Affero General Public License v3.0
541 stars 149 forks source link

After Upgrade to 9.1.2 from 9.0.0 error in log ""Could not find resource onlyoffice/js/desktop.js" #981

Closed rchaconmolero closed 2 months ago

rchaconmolero commented 3 months ago

Nextloud 28.0.4

After updating from 9.0.0 to 9.1.2 we get this message.

"app":"jsresourceloader","method":"GET","url":"/apps/dashboard/","message":"Could not find resource onlyoffice/js/desktop.js to load"

After uninstalling the app and reinstalling, - verifying that the nextcloud folder does not exist in app folder - this message continues to appear in nextloud.log "

,"app":"jsresourceloader","method":"GET","url":"/apps/dashboard/","message":"Could not find resource onlyoffice/js/desktop.js to load

rchaconmolero commented 3 months ago

Workaround -> Revert to 9.0.0 manually. Any ideas?

baltaner commented 3 months ago

Hi, same here with nextcloud 28.0.4 and onlyoffice 9.1.2 - we got a lot of this error-messages. As a workaround I did the following: In /nextcloud/apps/onlyoffice/js I copied onlyoffice-desktop.js to desktop.js and onlyoffice-desktop.js.map to desktop.js.map That stopped the error-messages

davidschillerJKU commented 3 months ago

@LinneyS The issue probably stems from this line.

Commit d20b985 removed the "onlyoffice-" prefix and that landed in version 9.1.0.

arnowelzel commented 2 months ago

JFTR: this problem does not occur here (OnlyOffice 9.1.2, Nextcloud 28.0.4). So it seems to be a bit harder to track down.

Just to be sure - maybe try the following:

Disable and remove OnlyOffice in Nextcloud.

Remove the backend URL in the app settings by applying the following SQL statement:

update oc_appconfig set configValue='' where appid='onlyoffice' and configKey='DocumentServerUrl';

Install OnlyOffice again.

Go to the administrative options of OnlyOffice and enter the URL of the backend again and save the options, so OnlyOffice will confirm that it can talk to the backend.

This way my upgrade from 9.0.0 to 9.1.2 worked fine.

geoglis commented 2 months ago

I tried the way mentioned by @arnowelzel. Unfortunately this did not help. I had to downgrade to version 9.0 Now it works again like a charme.

Nordlead75 commented 2 months ago

I have the same problem

davidschillerJKU commented 2 months ago

@geoglis @Nordlead75 Have you tried the following change on lib/Listeners/WidgetListener.php:

65c65
<             Util::addScript("onlyoffice", "desktop");
---
>             Util::addScript("onlyoffice", "onlyoffice-desktop");

This silenced the error for me. Alternatively you can rename the files like baltaner did.

arnowelzel commented 2 months ago

That is strange - here OnlyOffice 9.1.2 works without that change, i.e. with Util::addScript("onlyoffice", "desktop");

No errors at all and everything works as expected, eventhough the script is named js/onlyoffice-desktop.js and not js/desktop.js.

But according to https://docs.nextcloud.com/server/latest/developer_manual/basics/front-end/js.html this should not work at all, since Util::addScript() will add a script for a given application which is expected to exist in the js/ path with the given name. So maybe the WidgetListener is only used in specific situations. I just open end edit documents but disabled any kind of widgets in the files application, so maybe this is the reason, why I don't get any errors in the log?

Nordlead75 commented 2 months ago

Thanks a lot its done for me

Le 16 avr. 2024 à 16:55, Arno Welzel @.***> a écrit :

@geoglis https://github.com/geoglis @Nordlead75 https://github.com/Nordlead75 Have you tried the following change on lib/Listeners/WidgetListener.php:

65c65 < Util::addScript("onlyoffice", "desktop");

        Util::addScript("onlyoffice", "onlyoffice-desktop");

This silenced the error for me. Alternatively you can rename the desktop.js file like baltaner did.

That is strange - here OnlyOffice 9.1.2 works without that change, i.e. with Util::addScript("onlyoffice", "desktop");

No errors at all and everything works as expected, eventhough the script is named js/onlyoffice-desktop.js and not js/desktop.js.

But according to https://docs.nextcloud.com/server/latest/developer_manual/basics/front-end/js.html this should not work at all, since Util::addScript() will add a script for a given application which is expected to exist in the js/ path with the given name. So maybe the WidgetListener is only used in specific situations. I just open end edit documents but disabled any kind of widgets in the files application, so maybe this is the reason, why I don't get any errors in the log?

— Reply to this email directly, view it on GitHub https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/981#issuecomment-2059295318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXI7ZL5EREPQ4F4YLTBOBW3Y5U3XJAVCNFSM6AAAAABF6LWFZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJZGI4TKMZRHA. You are receiving this because you were mentioned.

joskapista44 commented 2 months ago

I have the same issue. Everything is the latest stable.

rchaconmolero commented 2 months ago

I tried the way mentioned by @arnowelzel. Unfortunately this did not help.

davidschillerJKU commented 2 months ago

I tried the way mentioned by @arnowelzel. Unfortunately this did not help.

You have to apply the patch mentioned above.

rchaconmolero commented 2 months ago

Indeed, making the changes in lib/Listeners/Widgets Listener.php as indicated by davidschillerJKU or renaming the "onlyoffice-desktop.js" file to "desktop.js" solves the problem. We will wait for a definitive solution before updating to 9.1.2