nextcloud_ynh icon indicating copy to clipboard operation
nextcloud_ynh copied to clipboard

Picker app doesn't work if nextcloud is installed on subfolder

Open Thatoo opened this issue 1 year ago • 7 comments

Describe the bug

Picker app doesn't work if nextcloud is installed on subfolder. I reported my issue in here : https://github.com/nextcloud/picker/issues/51

Context

  • Hardware: Old laptop or compute
  • YunoHost version: both last v11 version and last v12 version
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no

Steps to reproduce

  • Install nextcloud in a subdirectory https://domain.tld/nextcloud
    
  • go to https://domain.tld/nextcloud/index.php/apps/picker/single-link
    
  • Get the following error in console :
    
Uncaught (in promise) ChunkLoadError: Loading chunk node_modules_nextcloud_dialogs_dist_chunks_index-CYiQsZoY_mjs failed.
(error: https://domain.tld/apps/picker/js/picker-node_modules_nextcloud_dialogs_dist_chunks_index-CYiQsZoY_mjs.js?v=c2373e41314815cfcd22)

It obviously can't work as the link doesn't include the subfolder, it should be instead https://domain.tld/nextcloud/apps/picker/js/picker-node_modules_nextcloud_dialogs_dist_chunks_index-CYiQsZoY_mjs.js?v=c2373e41314815cfcd22

Expected behavior

picker should load

Logs

Browser log in console :

Uncaught (in promise) ChunkLoadError: Loading chunk node_modules_nextcloud_dialogs_dist_chunks_index-CYiQsZoY_mjs failed.
(error: https://zyuno.local/apps/picker/js/picker-node_modules_nextcloud_dialogs_dist_chunks_index-CYiQsZoY_mjs.js?v=c2373e41314815cfcd22)
    j jsonp chunk loading:27
    e ensure chunk:6
    e ensure chunk:5
    pick index.mjs:69
    <anonymous> main.js:128
    EventListener.handleEvent* main.js:163
    <anonymous> main.js:173
    <anonymous> main.js:173
[jsonp chunk loading:27:17](webpack:///picker/webpack/runtime/jsonp%20chunk%20loading)
    pick index.mjs:69
    AsyncFunctionThrow self-hosted:804
    (Asynchrone : async)
    <anonyme> main.js:128
    (Asynchrone : EventListener.handleEvent)
    <anonyme> main.js:163
    <anonyme> main.js:173
    <anonyme> main.js:173

Thatoo avatar Nov 05 '24 08:11 Thatoo

Could it be related to the mjs mime type issue ?

https://github.com/YunoHost-Apps/nextcloud_ynh/commit/3e9462656ebd60b0e5179b3ed342f9fcf9e67c10

zamentur avatar Feb 06 '25 03:02 zamentur

I don't know. How can I make a test to answer this question?

Thatoo avatar Feb 06 '25 08:02 Thatoo

Check if your instance has this line in the nginx config /etc/nginx/conf.d/domain.tld.d/nextcloud.conf

zamentur avatar Feb 06 '25 21:02 zamentur

not exactly :

include mime.types;
types {
    text/javascript mjs;
}

js is missing in text/javascript js mjs;

Thatoo avatar Feb 06 '25 21:02 Thatoo

js was removed because it is already present in default NGINX MIME type : https://github.com/YunoHost-Apps/nextcloud_ynh/pull/742

ericgaspar avatar Feb 06 '25 21:02 ericgaspar

https://domain.tld/apps/picker/js/picker-node_modules_nextcloud_dialogs_dist_chunks_index-CYiQsZoY_mjs.js?v=c2373e41314815cfcd22

Seems an upstream bug with picker apps. Indeed the url should be https://domain.tld/nextcloud/apps/picker/js/picker-node_modules_nextcloud_dialogs_dist_chunks_index-CYiQsZoY_mjs.js?v=c2373e41314815cfcd22

zamentur avatar Feb 09 '25 09:02 zamentur

The problem is that I don't know what to answer to the dev here : https://github.com/nextcloud/picker/issues/51#issuecomment-2456370842 My server is properly configured as it is configured by yunohost 😄

Thatoo avatar Feb 09 '25 11:02 Thatoo