web-branch-deep-linking-attribution
web-branch-deep-linking-attribution copied to clipboard
Uncaught TypeError: Cannot use 'in' operator to search for 'String' in undefined
When loading the branch-sdk npm package I get this error
build.min.js:formatted:1 Uncaught TypeError: Cannot use 'in' operator to search for 'String' in undefined
at ca (build.min.js:formatted:1)
at build.min.js:formatted:1
at Object../node_modules/branch-sdk/dist/build.min.js (build.min.js:formatted:1)
which traces to this line in the branch sdk f in c || (c[f] = {});.
(function() {
var aa = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) {
if (c.get || c.set)
throw new TypeError("ES3 does not support getters and setters.");
a != Array.prototype && a != Object.prototype && (a[b] = c.value)
}
, ba = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this;
function ca(a, b) {
if (b) {
for (var c = ba, d = a.split("."), e = 0; e < d.length - 1; e++) {
var f = d[e];
f in c || (c[f] = {});
c = c[f]
}
d = d[d.length - 1];
e = c[d];
f = b(e);
f != e && null != f && aa(c, d, {
configurable: !0,
writable: !0,
value: f
})
}
}
//...
Even if I don't "use" the branch sdk I get this error. Just by importing it this error fires.
@itslenny Did you fix this?
having the same issue
build.min.js:3 Uncaught TypeError: Cannot use 'in' operator to search for 'String' in undefined
at da (build.min.js:3)
at build.min.js:3
at Object../node_modules/branch-sdk/dist/build.min.js (build.min.js:174)
at __webpack_require__ (bootstrap:79)
at Module../src/shared/core/services/events/branch.service.ts (direct-transaction.service.ts:10)
at __webpack_require__ (bootstrap:79)
at Module../src/app/services/event.service.ts (currency.service.ts:16)
at __webpack_require__ (bootstrap:79)
at Module../src/app/onboarding/run-onboarding/run-onboarding.component.ts (main.js:32730)
at __webpack_require__ (bootstrap:79)
In order to fix it you should call branch.init() in component loading in your route, not in parent, just on page where you need branchIo.
temporary solution:
edit the minified bundle build.min.js

, ca = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : window;
// , ca = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this;
it just work and i dont know why they didnt fix it for so long
@jaslioin Thanks so much! That worked :-)
Any chance for an official release?
@jwangler-branch with a recent release, I'd have assumed this was fixed. But alas! It's still an issue!