Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object is not iterable (cannot read property Symbol(Symbol.iterator)) #177

Open
janderson-watchbox opened this issue Dec 20, 2024 · 0 comments

Comments

@janderson-watchbox
Copy link

u.searchParams & h.searchParams may be null and causes a TypeError -- and noisy error in Sentry

File: commerce-sdk-isomorphic/lib/index.esm.js

Source functions: loginGuestUser: function (e, t) {return vI.apply(this, arguments);}, loginRegisteredUserB2C: function (e, t, r) {return mI.apply(this, arguments);},

Line with error: if (((d = e.sent), (c = (null === (i = d.headers) || void 0 === i ? void 0 : i.get("location")) || d.url), (u = new URL(c)), (l = Object.fromEntries(u.searchParams.entries())), !(d.status >= 400 || l.error))) {
Line with error: if (((u = e.sent), (l = (null === (i = u.headers) || void 0 === i ? void 0 : i.get("location")) || u.url), (h = new URL(l)), (f = Object.fromEntries(h.searchParams.entries())), !(u.status >= 400 || f.error))) {

Suggested change: u.searchParams.entries to u.searchParams?.entries ?? {} and same for h.searchParams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant