0

so I get an error on my console when importing and calling the JsStore library object from within a service worker.

importScripts('https://cdn.jsdelivr.net/npm/[email protected]/dist/jsstore.min.js');
importScripts('https://cdn.jsdelivr.net/npm/[email protected]/dist/jsstore.worker.min.js');


var connection = new JsStore.Connection();

console.log(connection);

This gives a console error:

Uncaught TypeError: JsStore is not a constructor

Documentation which I followed.

1 Answer 1

0

This was as a result of using the Versioned scripts @3.0.0. I used the latest scripts as below:

and it worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.