I am developing multiple websites in angular with similar content and have therefore decided to extract common components and functionality into a separate angular 14 library.
I have previously successfully used the JSZip library in one of these websites with Angular 12, but have then decided to move this implementation into the library.
Even though the code did not change, it stopped working.
If I try to call the method that uses JSZip from the library it now throws the following TypeError
ERROR TypeError: (jszip__WEBPACK_IMPORTED_MODULE_1___namespace_cache || jszip__WEBPACK_IMPORTED_MODULE_1___namespace_cache) is not a constructor
Import library like this
import * as JSZip from 'jszip';
create a new JSZip instance like this
const zip = new JSZip();
Both the library and the website projects build correctly but throw this error at runtime, so I don't think it is a problem with dependencies.
Has someone encountered a similar problem before? What should I try to solve this?
Both the library and the website projects build correctly but throw this error at runtime, so I don't think it is a problem with dependencies.
Has someone encountered a similar problem before? What should I try to solve this?
I saw similar post like this