Comments (7)
Ok there's a space in the primary key "pubkey blocked". Haven't seen that before and i don't remember if that is valid in IndexedDB. Try with "pubkeyBlocked" or if blocked was meant to be a secondary index, "pubkey, blocked"
from dexie.js.
NOTE: I checked the Application tab in DevTools and noticed there is no database initiated, so this could be the root of the issue and not the data types. I am following this tutorial https://dexie.org/docs/Tutorial/Svelte using SvelteKit to setup my Dexie DB. I added the db.ts
file (using TypeScript) as shown there.
from dexie.js.
Update: I have tried explicitly calling the db.open()
method to ensure that the database is opened but I still receive the same DatabaseClosedError
with nothing showing up in IndexedDB
. I am not sure what I am doing differently from the tutorial to receive these errors...
from dexie.js.
I even tried using await
on db.open()
and the Promise resolves successfully but still it looks like no DB is opened and the error is thrown?
from dexie.js.
If this helps to debug here is a code snippet of my db.ts
file:
export class MySubClassedDexie extends Dexie {
conversations!: Table<Conversation>;
constructor() {
super('MyDB');
this.version(1).stores({
conversations: '&pubkey blocked' // Primary key and indexed props
});
}
}
export const db = new MySubClassedDexie();
from dexie.js.
Ah thanks a lot, I totally missed the ,
that is required. I was trying to set pubkey
as the primary and blocked
as another key. Sometimes it's the little things that take the longest to notice... It's working now. :)
from dexie.js.
Ah thanks a lot, I totally missed the
,
that is required. I was trying to setpubkey
as the primary andblocked
as another key. Sometimes it's the little things that take the longest to notice... It's working now. :)
Great to hear that it was the issue! Logging error.inner on the catched DatabaseClosedError would have revealed 'SyntaxError: Failed to execute 'createObjectStore' on 'IDBDatabase': The keyPath option is not a valid key path.'.
This reminds me that there might have been a good idea to let DatabaseClosedError.prototype.toString() reveal also the message from the inner exception (note to myself).
from dexie.js.
Related Issues (20)
- Seeking Guidance for Serverless Bi-directional Sync Between Two Dexie.js Instances HOT 7
- Dexie Cloud Feature request: user-specific public realm
- Is it possible to invite a user who is not signed up? HOT 6
- Error: too much recursion HOT 1
- Typescript returns errors regarding ID that is undefined HOT 11
- bulkDelete() for large number of primary keys is way too slow
- WebPush for DexieCloud Feature Request
- Dexie Cloud feature request: in-app invitations HOT 1
- dexie cloud db entries with image blob disapear HOT 2
- Return only one field?
- Typescript complain with compound ID HOT 2
- related tables in dexie HOT 2
- Dexie Cloud Manager - "Manage users" error HOT 3
- Authentication error with the fresh.deno framework HOT 1
- Issue with Dexie's table.where() Method when Targeting Existing IndexedDB with Indexed KeyPath
- "default" is not exported by "../../../Dexie.js/dist/dexie.min.js", imported by "../../../Dexie.js/import-wrapper-prod.mjs". HOT 14
- Transaction context is lost when running a recursive call in a loop HOT 8
- Backwards compatibility issue - ReferenceError: queueMicrotask is not defined HOT 2
- circularly reference on update HOT 10
- dexie-cloud feature request: Transaction support on REST API HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dexie.js.