Error from doFetch in Chrome console
Using the selectivity-rails (0.2.0) gem. I notice the following error from the doFetch function, selecting any entry.
selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:2528 Uncaught TypeError: fetch(...).then(...).then(...).catch is not a function at doFetch (selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:2528) at invokeFunc (selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:232) at trailingEdge (selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:279) at timerExpired (selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:267) doFetch @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:2528 invokeFunc @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:232 trailingEdge @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:279 timerExpired @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:267 setTimeout (async) leadingEdge @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:240 debounced @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:307 options.query @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:2550 options.query @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:2586 search @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:1066 (anonymous) @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:4871 search @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:3913 search @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:4442 (anonymous) @ selectivity.self-3115294f8e09eb7ec50b269e15cd6223f48262a40140de9e2b9a42ccb52047a2.js?body=1:4382
Sorry for the late reply. Are you using Selectivity in combination with jQuery? And if so, which version of jQuery? The reason I'm asking is because the AJAX functionality in Selectivity depends on the fetch() function which comes standard in modern browsers. For compatibility with older browsers (and consistency with other code using $.ajax()), the jQuery build of Selectivity comes with an implementation of fetch() that uses $.ajax() under the hood. However, this requires jQuery 3 or higher to work correctly because older versions of jQuery return a Promise-like object from $.ajax() that's incompatible with the Promise specification.
This is documented in the README in a small note for the "jquery/ajax" plugin, but if this is indeed the problem, I might need to document this more prominently.
Switched to select2 months ago. Thank you anyway.