When using keycloak.js in react app (using react scripts) we get 'TypeError: "Promise.prototype.then called on incompatible Object"':
I have testet my Code in Chrome (81.0.4044.138 (Official Build) (64-Bit)) and Firefox (68.8.0esr (64-Bit) and 76.0.1 (64-Bit)).
Chrome and Firefox 76.0.1 (64-Bit) work just fine.
But we also have to support the current ESR version of Firefox (which is (68.8.0esr (64-Bit)) showing the error avobe.
IE 11 also shows a lot of errors and switching back to keycloak.js 9.0.0 fixes them.
If i change createPromise in keycloak.js to
and replace all occurrences of setSuccess with resolve and setError with reject, it works just fine (also in IE 11).