Picker app doesn't work if nextcloud is installed on subfolder
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
Could it be related to the mjs mime type issue ?
https://github.com/YunoHost-Apps/nextcloud_ynh/commit/3e9462656ebd60b0e5179b3ed342f9fcf9e67c10
I don't know. How can I make a test to answer this question?
Check if your instance has this line in the nginx config /etc/nginx/conf.d/domain.tld.d/nextcloud.conf
not exactly :
include mime.types;
types {
text/javascript mjs;
}
js is missing in text/javascript js mjs;
js was removed because it is already present in default NGINX MIME type : https://github.com/YunoHost-Apps/nextcloud_ynh/pull/742
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
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 😄