Closed excitedelektron closed 1 year ago
@excitedelektron are you including jsstore worker file ?
I met the same error, I create new connection without using new Connection(new Worker(workerPath)) I just new Connection() then the error display like this err TypeError: Cannot read properties of undefined (reading 'run') at ConnectionHelper2.sendRequestToWorker_ (connectionhelper.ts:263:25) at ConnectionHelper2.executeQry (connectionhelper.ts:234:14) at ConnectionHelper2.prcoessExecutionOfQry (connection_helper.ts:212:10) at connection_helper.ts:198:14
Also what's
the meaning of this part?
getWorkerPath use file-loader to move the worker script to build
folder and return the path of that file, so that you can use in Worker.
const worker = new Worker(<worker file path>)
@LeoZxy @excitedelektron can you guys provide me a reproducable repo, so that i can help you guys.
Hi @ujjwalguptaofficial I use the vite + typescript
Could you clone this repo and run it? git@github.com:LeoZxy/jsstoreDemo.git
or you can just open this link to check it on codesandbox https://codesandbox.io/s/romantic-leftpad-59qx5h?file=/src/App.tsx
Hi @ujjwalguptaofficial @excitedelektron
I think we forget to add this code below
coonection.addPlugin(workerInjector)
now its seems working.
@excitedelektron hope your issue is also fixed, but if not please provide a reproducable repo - i am always there to help.
For now i am closing the issue.
Title
JsStore does not work without web worker
Description
I am trying to run the minimal version (without workers) verbatim from the official documentation but even that doesn't work: I am getting:
jsstore.js:549 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'run') at Connection.sendRequestToWorker (jsstore.js:549:31) at Connection.executeQry (jsstore.js:522:22) at Connection.prcoessExecutionOfQry_ (jsstore.js:508:14) at jsstore.js:495:23
I am using vanilla Javascript with jsstore v4.5.0
Here is my code:
Note: Description should contains the query, the current output & the expected output. You can use idbstudio to generate the example.