josephrocca / OpenCharacters

Simple little web interface for creating characters and chatting with them. It's basically a single HTML file - no server. Share characters using a link (character data is stored within the URL itself). All chat data is stored in your browser using IndexedDB. Currently supports OpenAI APIs and ~any Hugging Face model.
https://josephrocca.github.io/OpenCharacters
MIT License
364 stars 60 forks source link

Uncaught [object Object] #23

Open SamuelChih opened 1 year ago

SamuelChih commented 1 year ago

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 commented 1 year ago

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

SamuelChih commented 1 year ago

Just loading in the web page, I've open a fresh one in incognito mode and it is working normally.

On Sun, Apr 2, 2023, 2:31 PM josephrocca @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/josephrocca/OpenCharacters/issues/23#issuecomment-1493444805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLEAOFKFSTLVVRYVA5Y7D3W7HV4HANCNFSM6AAAAAAWQRG3H4 . You are receiving this because you authored the thread.Message ID: @.***>

josephrocca commented 1 year ago

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");