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

Uncaught [object Object] #23

Open
SamuelChih opened this issue Apr 2, 2023 · 3 comments
Open

Uncaught [object Object] #23

SamuelChih opened this issue Apr 2, 2023 · 3 comments

Comments

@SamuelChih
Copy link

SamuelChih commented Apr 2, 2023

josephrocca.github.io says
Please report this error on the Discord or Github:

stack: DatabaseClosedError: UnknownError Internal error opening
backing store for indexedDB.open.
UnknownError: Internal error opening backing store for
indexedDB.open.
at t (https://josephrocca.github.io/OpenCharacters/:10:18817)
at https://josephrocca.github.io/OpenCharacters/:10:19017
at https://josephrocca.github.io/OpenCharacters/:10:16578
at Fe (https://josephrocca.github.io/OpenCharacters/:10:10996)
at Ue (https:/bosephrocca.github.io/OpenCharacters/:10:11472)
at Ne (https:/josephrocca.github.io/OpenCharacters/:10:11326)
line: 0

image
image

@josephrocca
Copy link
Owner

Hmm - what were you doing that led to this message? Just loading the web page, or importing a file, or something else?

@SamuelChih
Copy link
Author

SamuelChih commented Apr 2, 2023 via email

@josephrocca
Copy link
Owner

josephrocca commented Apr 2, 2023

Strange - did you have any data (characters/threads)? And you're using Chrome, right?

If you open up the browser console and paste this code, does it download dump.json?

// import dexie.js (for opening indexed db)
await new Promise(async resolve => {
  let loaded = 0;
  let script1 = document.createElement('script');
  script1.onload = () => loaded++;
  script1.src = 'https://unpkg.com/dexie@3.2.3';
  document.body.appendChild(script1);
  let script2 = document.createElement('script');
  script2.onload = () => loaded++;
  script2.src = 'https://unpkg.com/dexie-export-import@4.0.6';
  document.body.appendChild(script2);
  while(loaded < 2) await new Promise(r => setTimeout(r, 100));
  resolve();
});

// for saving the json database dump
function downloadText(text, filename) {
  const blob = new Blob([text], {type: "application/json"});
  const dataUri = URL.createObjectURL(blob);
  let linkElement = document.createElement("a");
  linkElement.setAttribute("href", dataUri);
  linkElement.setAttribute("download", filename);
  linkElement.click();
  linkElement.remove();
  setTimeout(() => URL.revokeObjectURL(dataUri), 30*1000);
}

// save the database:
let db = new Dexie("chatbot-ui-v1");
let {verno, tables} = await db.open();
db.close();
db = new Dexie("chatbot-ui-v1");
db.version(verno).stores(tables.reduce((p,c) => {p[c.name] = Array.isArray(c.schema.primKey.keyPath) ? "["+c.schema.primKey.keyPath.join("+")+"]" : c.schema.primKey.keyPath ? c.schema.primKey.keyPath : ""; return p;}, {}));
let text = await db.export().then(blob => blob.text());
downloadText(text, "dump.json");

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

2 participants