TypeError when opening folder share dialog

I just set up a self hosted nextcloud installation with the goal of being able to share files more easily. When I click on the share icon for a file, the share sidebar comes up on the right with sharing options, as expected. However, when I click the same share icon for any folder in my nextcloud, the sidebar comes up and the loader just keeps loading forever, and I don’t seem to be able to share any folders. Does anyone have any ideas on what might be causing this?

I looked at the javascript console and it seems to be caused by this javascript error:

TypeError: Cannot read properties of undefined (reading 'getIconUrl')
    at o.getIconUrl (Sidebar.vue:380:1)
    at o.getPreviewIfAny (Sidebar.vue:352:1)
    at o.background (Sidebar.vue:243:1)
    at e.get (vue.runtime.esm.js:3446:33)
    at e.evaluate (vue.runtime.esm.js:3547:27)
    at o.background (vue.runtime.esm.js:5541:25)
    at o.appSidebar (Sidebar.vue:257:1)
    at e.get (vue.runtime.esm.js:3446:33)
    at e.evaluate (vue.runtime.esm.js:3547:27)
    at o.appSidebar (vue.runtime.esm.js:5541:25)

This seems to be a UI issue since it works fine in the iOS app.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Click on the share icon for any folder
  2. the sidebar comes up and loads forever

Server configuration detail

Operating system: Linux 6.1.64-Unraid #1 SMP PREEMPT_DYNAMIC Wed Nov 29 12:48:16 PST 2023 x86_64

Webserver: nginx/1.24.0 (fpm-fcgi)

Database: mysql 10.11.5

PHP version: 8.2.13

Modules loaded: Core, date, libxml, pcre, zlib, filter, hash, json, random, readline, Reflection, SPL, session, zend_test, cgi-fcgi, bcmath, bz2, ctype, curl, dom, fileinfo, ftp, gd, gmp, iconv, standard, intl, ldap, mbstring, openssl, pcntl, PDO, pgsql, posix, imap, SimpleXML, sockets, sodium, sqlite3, sysvsem, xml, xmlwriter, zip, exif, mysqlnd, pdo_pgsql, pdo_sqlite, Phar, xmlreader, pdo_mysql, apcu, msgpack, igbinary, redis, memcached, imagick, mcrypt, smbclient, libsmbclient, Zend OPcache

Nextcloud version: 28.0.1 -

Updated from an older Nextcloud/ownCloud or fresh install: Fresh install

Where did you install Nextcloud from:

Signing status

List of activated apps
 - activity: 2.20.0
 - admin_audit: 1.18.0
 - bruteforcesettings: 2.8.0
 - circles: 28.0.0-dev
 - cloud_federation_api: 1.11.0
 - comments: 1.18.0
 - contactsinteraction: 1.9.0
 - dashboard: 7.8.0
 - dav: 1.29.1
 - federatedfilesharing: 1.18.0
 - federation: 1.18.0
 - files: 2.0.0
 - files_pdfviewer: 2.9.0
 - files_reminders: 1.1.0
 - files_sharing: 1.20.0
 - files_trashbin: 1.18.0
 - files_versions: 1.21.0
 - firstrunwizard: 2.17.0
 - integration_notion: 0.1.4
 - logreader: 2.13.0
 - lookup_server_connector: 1.16.0
 - nextcloud_announcements: 1.17.0
 - notifications: 2.16.0
 - oauth2: 1.16.3
 - onlyoffice: 9.0.0
 - password_policy: 1.18.0
 - photos: 2.4.0
 - privacy: 1.12.0
 - provisioning_api: 1.18.0
 - recommendations: 2.0.0
 - related_resources: 1.3.0
 - serverinfo: 1.18.0
 - settings: 1.10.1
 - sharebymail: 1.18.0
 - socialsharing_email: 3.0.1
 - support: 1.11.0
 - survey_client: 1.16.0
 - systemtags: 1.18.0
 - text: 3.9.1
 - theming: 2.3.0
 - twofactor_backupcodes: 1.17.0
 - updatenotification: 1.18.0
 - user_status: 1.8.1
 - viewer: 2.2.0
 - weather_status: 1.8.0
 - workflowengine: 2.10.0
 - encryption
 - files_external
 - suspicious_login
 - twofactor_totp
 - user_ldap

Configuration (config/config.php)
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "",
    "overwrite.cli.url": "https:\/\/removed.com\/",
    "overwritehost": "removed.com",
    "overwriteprotocol": "https",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "filelocking.enabled": true,
    "memcache.locking": "\\OC\\Memcache\\APCu",
    "upgrade.disable-web": true,
    "mail_smtpmode": "smtp",
    "mail_smtpsecure": "ssl",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "simpleSignUpLink.shown": false

Cron Configuration: Array
[backgroundjobs_mode] => cron
[lastcron] => 1703640002

External storages: files_external is disabled

Encryption: no


  • OC\User\Database

Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

I have the same Issue, with a Docker Container. I found that there is a Javascript Error when it don’t work. But I have no explanation why and what’s the origin

hi @jeffkmeng welcome to the forum :handshake:

you are missing the required support template. Please fill this form out and edit into your post. This will give us the technical info and logs needed to help you in case the machine in question in spitting out errors! Since you’ve provided zero technical details it is impossible to help you as-is. Thanks.

Please use the search - lot of issues have been discussed already e.g. sharing issue on 28.0.0 is known

but nobody can tell you if it’s the same as you decided to ignore the support template!

If there are specific issues or error please describe what you tried so far and which problems you hit!

Sorry, I just edited it into my post. I also looked some more at the javascript console and think I found the specific javascript cause of the problem (also edited into the post).

1 Like

This is not the same Issue. The sahring should work only on the local system and it is not the function that not works. because on some files the sharing works. It is only the function at the frontend which don’t work for some files and all folder.

jeffkmeng look closer, there is only one message which is appear when you click the sharing icon and which is not appear, when you click the sharing icon e.g. of a readme.md file. than the sharing dialog will appear.

The other error messages came when loading the whole site. But of course they could be the reason of the concrete problem. But I wonder, why then it works sometime or didn’t it?

I don’t see the issue with NC 28.0.1 docker/Apache. I can share both files and folder without issues.

In my other posting I wrote that the only thing I did was to “move” the installation into a subfolder like it is describe here. could this the reason?

another point is, that the nextcloud is behind a reverse proxy. so I had done some configuration at this point to get access to all services. May there is a service in the background which is also need to get fix in this situation?

And since I get this Javascript error message, there must be a problem on the way from the nexcloud server to my browser. I did everything to investigate but I only found this message. I deleted Cookes several times, did use several Browsers and NC accounts. I got always the same error message and have the same problem. I can’t share folders in my local installation.

@struppi For me, I do get the error message only when I click on the sharing button for folders – it’s not a error message from the general site. I also want to note that for me, this is just a UI issue – on the iOS app, I can share folders without issue.

I played around with the JS debugger a bit and it seems like the error I’m encountering is that OC.MimeType is never defined, which is causing this line to throw an error. It seems like this getIconUrl is only called on folders and not files when showing the share dialog for some reason, which is why I only seem to encounter this error on files.

This leads me to believe that the mimetype.js file is never being loaded for me for some reason? Though I’m not familiar enough with the codebase to understand how that part is supposed to work.

Oh, I just work on a desktop Browser. I delete all erros in the console and if I click for example at sharing icon for the picture “nextcloud.png” everything work finde and no error. But on the folder sharing icon I got the message as you got. but only this one. did you delete the console?

But I hink you are right. The problem is the undefined OC.MimeType, exactly the same what my console says.

[EDIT]I tried it on the android app and there everythink is working. So, the problem is mostly the same on desktop browser and IOS app, but not on android.

I’m getting the same TypeError: OC.MimeType is undefined error whenever the sidebar on web is opened for folders and certain file types.

Are there any workarounds for fixing this?

I have the same problem. Looks like the error only occur with file/folder without thumbnail picture e.g. mp4, pdf, folders. Is there a github issue for this?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.