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
Unable to use Array.push inside once() #1332
Comments
This kinda solve the issue, sometimes still got the error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I do a hard refresh I got this error,
but If I came from my menu page, it's loads with no errors
Uncaught TypeError: Cannot add property 1, object is not extensible
at Array.push ()
at Gun. (product.js:37:1)
at once (gun.js:1250:1)
My method functions
export function fetchUserProducts(pub) { return new Promise((resolve, reject) => { g.user(pub).get(PRODUCT_PATH, async function(ack) { if (ack.err) { reject(ack.err); } else if (!ack.put) { reject('Unable to load products'); } else { const list = []; g.user() .get(PRODUCT_PATH) .map() .once(function(product, id) { const p = { id: id, name: product.name, }; list.push(p); }) .once(async function() { resolve(list); }); } }); }); }
pd: sorry for my format code :(
The text was updated successfully, but these errors were encountered: