v0.12.1
Patch Changes
-
0831623: ### Browser Compatibility Fix
Fixed a bundler error that occurred when using c2pa-ts in browser environments (e.g., Next.js with Turbopack).
Problem:
Top-level imports of Node.jsfsandfs/promisesmodules inBlobDataReaderandBufferDataReadercaused build failures in browser bundlers, even though thewriteToFile()method is only intended for Node.js usage.Solution:
Converted static top-level imports to dynamic imports insidewriteToFile()methods. This ensures thefsmodules are only loaded whenwriteToFile()is actually called at runtime, allowing the library to be bundled for browser environments without errors.Note: The
writeToFile()method remains Node.js-only and will fail if called in a browser environment.