简体   繁体   English

JsStore 构造函数未捕获的类型错误

[英]JsStore Constructor Uncaught TypeError

so I get an error on my console when importing and calling the JsStore library object from within a service worker.因此,从服务人员中导入和调用 JsStore 库 object 时,我的控制台上出现错误。

importScripts('https://cdn.jsdelivr.net/npm/jsstore@3.0.0/dist/jsstore.min.js');
importScripts('https://cdn.jsdelivr.net/npm/jsstore@3.0.0/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未捕获的 TypeError:JsStore 不是构造函数

Documentation which I followed.我遵循的文档

This was as a result of using the Versioned scripts @3.0.0.这是使用版本化脚本@3.0.0 的结果。 I used the latest scripts as below:我使用了最新的脚本如下:

and it worked.它奏效了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM