mirror of
https://github.com/appy-one/acebase.git
synced 2026-05-25 06:02:14 -06:00
[GH-ISSUE #6] Live proxy: Uncaught (in promise) TypeError: Cannot read property 'push' of undefined #4
Labels
No labels
IndexedDB
browser
bug
dependencies
documentation
duplicate
enhancement
feature request
indexes
indexes
invalid
pull-request
query
question
transaction logging
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/acebase#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @paradis-A on GitHub (Feb 9, 2021).
Original GitHub issue: https://github.com/appy-one/acebase/issues/6
Originally assigned to: @appy-one on GitHub.
I was trying to live proxy using the following your example
but changed a bit of your example. becase i dont want to wrap to async.
liveChat.messages.push throws
Uncaught (in promise) TypeError: Cannot read property 'push' of undefined
@appy-one commented on GitHub (Feb 10, 2021):
Apparently the proxy example documentation contains a couple mistakes, thanks for reporting.
.pushcan only be called on an object collection. Because the chat the code is creating does not have the propertymessagesyet, we can'tpushan object to it. AddingliveChat.messages = {};before the first push will fix that.I see you added an
if (liveChat.onChange), probably because that also threw an error. The code should beliveChat.onChanged(...). Note the typo in the example code, it must beonChanged