Hello all, glad to come across this awesome library.
I have used it for a group project. But the data only set on the first table when I set 2 using set method. If you would kindly look into this issue that would be very helpful
Framework: Vue 2
Language used: Typescript and js
Browser Tested: Vivaldi, Chromium, firefox
I have set 2 tables, question and label, and the code is as follows:
private async mounted(){
let db = new Localbase('db');
... get data with axios
// save in the local db
const labelsForDB = this.mainLabels.map((data, index) => ({
_key: `100${index}`,
...data
}));
const questionsForDB = this.rawQuestions.map((data, index) => ({
_key: `200${index}`,
...data
}));
await db.collection('labels').set(labelsForDB, {keys: true});
await db.collection('questions').set(questionsForDB, {keys: true});
When I test it on browsers, only the label table gets the data. Only occasionally will both table get the data
Here is the error message when I tested it on vivaldi (the consoles are the same across browsers)
keys provided
logger.js?4cd9:17 localbase Collection "labels" set with 3 Documents. (3) [{…}, {…}, {…}]
logger.js?4cd9:17 localbase Document added to "labels" collection. {key: '1000', data: {…}}
set.js?54f5:32 keys provided
logger.js?4cd9:17 localbase Collection "questions" set with 4 Documents. (4) [{…}, {…}, {…}, {…}]
4add.js?391c:30 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'setItem')
at eval (add.js?391c:30)
at new Promise (<anonymous>)
at Localbase.add (add.js?391c:19)
at eval (set.js?54f5:52)
at Array.forEach (<anonymous>)
at eval (set.js?54f5:49)
And when I check the file, the error points to the following file node_modules/localbase/actions/add.js on the following line:
return this.lf[collectionName].setItem(key, data).then(() => {
I am new to indexedDB so not sure if anything is missing here. If more info is needed please kindly let me know. Thank you!
Hello all, glad to come across this awesome library. I have used it for a group project. But the data only set on the first table when I set 2 using set method. If you would kindly look into this issue that would be very helpful
Framework: Vue 2 Language used: Typescript and js Browser Tested: Vivaldi, Chromium, firefox I have set 2 tables, question and label, and the code is as follows:
When I test it on browsers, only the label table gets the data. Only occasionally will both table get the data Here is the error message when I tested it on vivaldi (the consoles are the same across browsers)
And when I check the file, the error points to the following file
node_modules/localbase/actions/add.js
on the following line:return this.lf[collectionName].setItem(key, data).then(() => {
I am new to indexedDB so not sure if anything is missing here. If more info is needed please kindly let me know. Thank you!