Replies: 1 comment
-
you need to change code for jsstore initiation. Here is doc for jsstore without web worker - https://jsstore.net/tutorial/connection/#webpack-without-web-worker |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I use [email protected] and can't figure out why I am able to create connection only with web worker. Without it throws error in console:
jsstore.commonjs2.js:595 Uncaught (in promise) TypeError: Cannot read property 'run' of undefined
at Connection.push../node_modules/jsstore/dist/jsstore.commonjs2.js.module.exports.2.ConnectionHelper.sendRequestToWorker_ (jsstore.commonjs2.js:595)
at Connection.push../node_modules/jsstore/dist/jsstore.commonjs2.js.module.exports.2.ConnectionHelper.executeQry_ (jsstore.commonjs2.js:568)
at Connection.push../node_modules/jsstore/dist/jsstore.commonjs2.js.module.exports.2.ConnectionHelper.prcoessExecutionOfQry_ (jsstore.commonjs2.js:554)
My code:
import {
Connection,
} from 'jsstore';
const getWorkerPath = () => {
if (process.env.NODE_ENV === 'development') {
return require('file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js');
}
};
const workerPath = getWorkerPath().default;
export const idbCon = new Connection(new Worker(workerPath)); ---- works but
// export const idbCon = new Connection(); ---- doesn't work
The reason why I want to switch to connection without web-worker is that I want to update rows in table using mapSet property and this function should be build dynamically based on user's input. So I can't create file update_logic.js for web worker with this function that I don't know at the moment.
Could you help please, what is wrong with connection creation?
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions