Summary
cicero-core's TemplateSaver.toArchive() and TemplateLoader.fromArchive() depend on Node.js fs, making them unusable in browser environments.
This came up in accordproject/template-playground#562, where we need to import/export .cta archives client-side but can't use the existing cicero-core API.
Notes
TemplateSaver.toArchive() and TemplateLoader.fromArchive() already use JSZip internally and operate on buffers, not the filesystem directly. The browser incompatibility likely comes from transitive Node.js imports (path, fs from fromDirectory() and the filesystem-based loaders) being pulled into the bundle.
A potential fix could be adding a "browser" field in package.json to exclude Node-only modules, or providing a separate browser entry point that only exposes the archive-compatible methods.
Expected
A browser-compatible bundle/entry point for cicero-core's archive create/extract functionality, so downstream browser apps don't need to reimplement the ZIP logic with JSZip directly.
References
Summary
cicero-core'sTemplateSaver.toArchive()andTemplateLoader.fromArchive()depend on Node.jsfs, making them unusable in browser environments.This came up in accordproject/template-playground#562, where we need to import/export
.ctaarchives client-side but can't use the existing cicero-core API.Notes
TemplateSaver.toArchive()andTemplateLoader.fromArchive()already use JSZip internally and operate on buffers, not the filesystem directly. The browser incompatibility likely comes from transitive Node.js imports (path,fsfromfromDirectory()and the filesystem-based loaders) being pulled into the bundle.A potential fix could be adding a
"browser"field inpackage.jsonto exclude Node-only modules, or providing a separate browser entry point that only exposes the archive-compatible methods.Expected
A browser-compatible bundle/entry point for cicero-core's archive create/extract functionality, so downstream browser apps don't need to reimplement the ZIP logic with JSZip directly.
References