You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: e[n].toUpperCase is not a function
File "node_modules/amplitude-js/amplitude.umd.js" line 2872 col 24 in enumerize
enums[arr[i].toUpperCase()] = arr[i];
File "node_modules/amplitude-js/amplitude.umd.js" line 3333 col 26 in [anonymous]
UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]);
File "node_modules/amplitude-js/amplitude.umd.js" line 2809 col 5 in [anonymous]
(function (window, undefined$1) {
File "node_modules/amplitude-js/amplitude.umd.js" line 1902 col 8 in createCommonjsModule
}, fn(module, module.exports), module.exports;
File "node_modules/amplitude-js/amplitude.umd.js" line 2796 col 18 in [anonymous]
var uaParser = createCommonjsModule(function (module, exports) {
File "node_modules/amplitude-js/amplitude.umd.js" line 4 col 83 in [anonymous]
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typ...
File <no filename> line 4 col 83 in Object.120
File "webpack/bootstrap" line 68 col 22 in __webpack_require__
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
File <no filename> line 7 col 23 in Module.279
File "webpack/bootstrap" line 68 col 22 in __webpack_require__
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
Do you have any idea why?
Environment
JS SDK Version: 8.8.0
Installation Method: import amplitude from "amplitude-js"
Browser and Version: Chrome 94
The text was updated successfully, but these errors were encountered:
We have used a patch in our app to mitigate this issue, however I found that in the affecting package, @amplitude/ua-parser-js, a PR has already been filed 17 days ago but received no responses from the team. The patch is described below and can be applied using patch-package in case someone needs it to mitigate this issue:
diff --git a/node_modules/amplitude-js/amplitude.umd.js b/node_modules/amplitude-js/amplitude.umd.js--- a/node_modules/amplitude-js/amplitude.umd.js+++ b/node_modules/amplitude-js/amplitude.umd.js@@ -2817,7 +2817,9 @@
enumerize = function (arr) {
var enums = {};
for (var i in arr) {
- enums[arr[i].toUpperCase()] = arr[i];+ if (arr.hasOwnProperty(i)) {+ enums[arr[i].toUpperCase()] = arr[i];+ }
}
return enums;
},
Hi, we see in our javascript tracking system (Rollbar) that some users experience this error with this code in the
amplitude-js/amplitude.umd.js
.Do you have any idea why?
Environment
The text was updated successfully, but these errors were encountered: