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

bulkUpdate method throws "Cannot read properties of undefined (reading 'getMany')" #2087

Open
phoben opened this issue Oct 23, 2024 · 0 comments

Comments

@phoben
Copy link

phoben commented Oct 23, 2024

Hello,

I'm encountering an issue when using the bulkUpdate method in Dexie.js.

Environment:

Dexie.js version: [Please specify the version you're using]
Browser: [e.g., Chrome, Firefox, etc.]
Operating System: [e.g., Windows 10, macOS Big Sur, etc.]
Steps to Reproduce:

I have an external JSON object _data:

[  
    {  
        "key": "qr-0001",  
        "changes": {  
            "time": "2024-10-23"  
        }  
    },  
    {  
        "key": "qr-0002",  
        "changes": {  
            "time": "2024-10-23"  
        }  
    },  
    {  
        "key": "qr-0003",  
        "changes": {  
            "time": "2024-10-23"  
        }  
    }  
]  

I attempt to call bulkUpdate as follows:

var res = await table.bulkUpdate(_data); 

When executing this code, I receive the following error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getMany')
By tracing through dexie.min.js, I found that the error originates from the ht.prototype.bulkUpdate function.

Additional Information:

Other methods like bulkPut and update work correctly with the same table instance.
The table is properly initialized and open.
_data is a JavaScript array of objects (not a JSON string), and I confirmed its structure matches the expected format for bulkUpdate.
I have checked that the bulkUpdate method exists on the table instance and is a function.
Question:

Is there something I'm missing in how I'm using the bulkUpdate method? Could this be a bug in Dexie.js, or is there a specific requirement for the data format that I'm overlooking?

Any guidance or assistance would be greatly appreciated.

Thank you!

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