ujjwalguptaofficial / JsStore

A complete IndexedDB wrapper with SQL like syntax.
http://jsstore.net/
MIT License
849 stars 109 forks source link

dynamic-user-behavior.service.ts:88 TypeError: Cannot read properties of undefined (reading 'run') #298

Closed huajian123 closed 1 year ago

huajian123 commented 1 year ago

Title

chrome error: Add your title here](dynamic-user-behavior.service.ts:88 TypeError: Cannot read properties of undefined (reading 'run'))

Description

jsstore version 4.4.4

without web work and this is the code:

    <script src="scripts/jsstore.js"></script>
    <script src="scripts/jsstore.worker.js"></script>
export const idbCon = new Connection();

  async initJsStore(): Promise<boolean> {
    const dataBase = getDatabase();
    return await idbCon.initDb(dataBase);
  }

  async initJsStore(): Promise<boolean> {
    const dataBase = getDatabase();
    return await idbCon.initDb(dataBase);
  }
ujjwalguptaofficial commented 1 year ago

seems like your jsstore worker is not loaded and you are trying to run query before that. I tested in v - 4.4.4 and all is working normal.

If issue persists, please provide me a reproducible repo.

huajian123 commented 1 year ago

@ujjwalguptaofficial Thank you very much, I have successfully loaded jsstore worker。But i found a bug, it doesn't work in chrome browser, it works fine in firefox browser。 image I don't know how to fix it

huajian123 commented 1 year ago

now I use the demo version 4.0.1 the demo is jsstore-examples-without_web_worker

ujjwalguptaofficial commented 1 year ago

@huajian123 it might be database got corrupted due to different version of codes, try to clear the indexeddb database and then refresh the page or try chrome incognito.

huajian123 commented 1 year ago

@ujjwalguptaofficial It works fine on other people's computers, but I suspect it's a browser cache problem. thank you very much for your help