The error occurs when the filename has something like 01 and 010 .
files.js:3 Uncaught ReferenceError: sort_methods is not defined
at locale (files.js:3)
at l (files.js:3)
at i (list.min.js:1)
at Array.sort(<anonymous>)
...
...
You can test creating a new folder named 01 and a folder 010. error is coming
'sort_function' => 'locale' // 'locale', 'basic', '[locale]'
Modify the option sort_function to basic to run normally .
sort_function
Assigns the sort function used for sorting file names. With default locale option, sorting is handled by Javascript localeCompare(), which sorts cAsE-insensitive, numbered names [2name<10name] and resolves unicode [èáø] depending on browser locale. Optionally, basic sort is slightly faster, but may not resolve numbered names and unicode correctly. You can also specify a locale, which decides the language to be used for localeCompare() sorting.
I have mentioned this error before: https://forum.files.gallery/d/64-menu-max-depth-option-wrong/2