ujjwalguptaofficial/JsStore

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

huajian123 opened this issue · 5 comments

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

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.

@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

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

@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.

@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