chore: update @anuma/sdk to 1.0.0-next.20260423203831#13
chore: update @anuma/sdk to 1.0.0-next.20260423203831#13Denis Fadeev (fadeev) wants to merge 1 commit intomainfrom
Conversation
|
✅ Cloudflare Workers Preview — Deployed! |
| html2canvas: 1.4.1 | ||
| jspdf: 4.2.1 |
There was a problem hiding this comment.
Browser-only dependencies added as non-optional SDK deps
html2canvas@1.4.1 and jspdf@4.2.1 are now non-optional direct dependencies of @anuma/sdk. html2canvas in particular relies heavily on browser DOM APIs (document, window, HTMLCanvasElement). This project deploys to Cloudflare Workers (via wrangler deploy), which does not expose DOM APIs.
If the SDK imports html2canvas at the module top level (rather than lazily), the Workers deployment will fail at startup with a ReferenceError: document is not defined (or similar). Even with lazy imports, any code path that triggers html2canvas at runtime would crash in the Workers environment.
Before merging, confirm that:
- The SDK conditionally/lazily imports
html2canvasonly in browser environments, and - This Telegram bot's usage of
@anuma/sdkdoes not exercise those code paths in the Workers runtime.
Prompt To Fix With AI
This is a comment left during a code review.
Path: pnpm-lock.yaml
Line: 1336-1337
Comment:
**Browser-only dependencies added as non-optional SDK deps**
`html2canvas@1.4.1` and `jspdf@4.2.1` are now **non-optional** direct dependencies of `@anuma/sdk`. `html2canvas` in particular relies heavily on browser DOM APIs (`document`, `window`, `HTMLCanvasElement`). This project deploys to **Cloudflare Workers** (via `wrangler deploy`), which does not expose DOM APIs.
If the SDK imports `html2canvas` at the module top level (rather than lazily), the Workers deployment will fail at startup with a `ReferenceError: document is not defined` (or similar). Even with lazy imports, any code path that triggers html2canvas at runtime would crash in the Workers environment.
Before merging, confirm that:
1. The SDK conditionally/lazily imports `html2canvas` only in browser environments, and
2. This Telegram bot's usage of `@anuma/sdk` does not exercise those code paths in the Workers runtime.
How can I resolve this? If you propose a fix, please make it concise.44d0a7c to
e9f9ed6
Compare
| '@anuma/portal': 1.0.0-next.20260306183544 | ||
| ai: 5.0.93(zod@4.3.6) | ||
| exceljs: 4.4.0 | ||
| html2canvas: 1.4.1 |
There was a problem hiding this comment.
Browser-only html2canvas may crash Cloudflare Workers
High Severity
html2canvas@1.4.1 is now a non-optional direct dependency of @anuma/sdk. This library requires browser DOM APIs (document, window, HTMLCanvasElement) that do not exist in the Cloudflare Workers runtime. Since this project deploys to Workers (confirmed by wrangler.jsonc and src/worker.ts), any eager/top-level import of html2canvas by the SDK will cause a startup crash with a ReferenceError.
There was a problem hiding this comment.
Bugbot Autofix determined this is a false positive.
I verified that importing @anuma/sdk/server and @anuma/sdk/client in a non-DOM runtime and bundling the Worker do not load or include html2canvas, so no startup crash occurs.
b77566f to
6d81606
Compare
6d81606 to
a68f435
Compare
a68f435 to
99833a9
Compare
99833a9 to
857a466
Compare
857a466 to
ba03d35
Compare
16bf5f2 to
900d08f
Compare
0696794 to
aa74711
Compare
aa74711 to
51f3f06
Compare
7e2cf0c to
8cf4d23
Compare
930f420 to
bccd621
Compare
bccd621 to
7597440
Compare
ee07867 to
1b69cfa
Compare
4540d3e to
623f177
Compare
623f177 to
53a6f1b
Compare
53a6f1b to
4cca574
Compare
b477106 to
bdc3bb5
Compare
bdc3bb5 to
5991682
Compare
860c5dc to
90fac6a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit 90fac6a. Configure here.
| "license": "MIT", | ||
| "dependencies": { | ||
| "@anuma/sdk": "1.0.0-next.20260319135746", | ||
| "@anuma/sdk": "1.0.0-next.20260423203831", |
There was a problem hiding this comment.
PR description has wrong version and missing sections
Low Severity
The PR description states it updates to 1.0.0-next.20260320013605, but the actual version in package.json is 1.0.0-next.20260423203831. Additionally, per CLAUDE.md, PR descriptions for SDK updates must include Integration and Breaking Changes sections — even if just noting "none required" — but both are absent.
Reviewed by Cursor Bugbot for commit 90fac6a. Configure here.
90fac6a to
b356725
Compare
b356725 to
6217666
Compare


Updates
@anuma/sdkto1.0.0-next.20260320013605.Note
Medium Risk
Primarily a dependency bump, but the new
@anuma/sdkbrings in browser-oriented packages (e.g.html2canvas,jspdf) that could break Cloudflare Workers builds/runtime if imported on the server path.Overview
Bumps
@anuma/sdkfrom1.0.0-next.20260319135746to1.0.0-next.20260423203831.Updates
pnpm-lock.yamlaccordingly, pulling in new direct SDK dependencies likehtml2canvas,jspdf, andmarked(plus related transitive packages), which may impact bundle size and Workers compatibility depending on how the SDK loads them.Reviewed by Cursor Bugbot for commit 6217666. Bugbot is set up for automated code reviews on this repo. Configure here.
Greptile Summary
This PR bumps
@anuma/sdkfrom1.0.0-next.20260319135746to1.0.0-next.20260320013605. The new SDK version introduces three non-optional direct dependencies —html2canvas@1.4.1,jspdf@4.2.1, andmarked@15.0.12— along with ~15 transitive packages (e.g.canvg,core-js,dompurify,fflate,stackblur-canvas).html2canvas,jspdf, andmarkedsuggest the SDK now bundles PDF-export and markdown-rendering capabilities directly.html2canvasis a browser-centric library that accesses DOM APIs absent in the Workers runtime. Since it is a non-optional dependency in the new SDK version, a top-level import of it in the SDK would cause a runtime crash on the Workers deployment path.pako: Bothpako@1.0.11(existing) andpako@2.1.0(new, viafast-png←jspdf) are now present, adding minor redundancy to the bundle.CLAUDE.mdguidelines, PR descriptions for SDK updates should include an Integration section (how to integrate new SDK changes into a client app) and a Breaking Changes section. These are absent from the current description; even noting "no integration steps required" and "no breaking changes" would satisfy the guideline.Confidence Score: 3/5
html2canvasdependency is lazily imported by the SDK and does not execute in the Cloudflare Workers runtime.html2canvasas a non-optional dependency. This library relies on browser DOM APIs incompatible with Cloudflare Workers. Without confirmation that the SDK guards these imports for browser-only contexts, the Workers deployment path carries real breakage risk.pnpm-lock.yaml— specifically the@anuma/sdksnapshot at line 1336 wherehtml2canvasappears as a non-optional dependency.Important Files Changed
@anuma/sdkfrom1.0.0-next.20260319135746to1.0.0-next.20260320013605— a straightforward version pin change with no other modifications.html2canvas,jspdf,marked) plus ~15 transitive packages.html2canvasis browser-only and may be incompatible with the Cloudflare Workers deployment target.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD SDK["@anuma/sdk\n1.0.0-next.20260320013605"] SDK --> EXISTING["Existing deps\n(ai, exceljs, jszip,\nmammoth, pdfjs-dist,\ntesseract.js, react)"] SDK --> HTML2CANVAS["html2canvas@1.4.1\n⚠️ Browser-only (DOM APIs)"] SDK --> JSPDF["jspdf@4.2.1"] SDK --> MARKED["marked@15.0.12"] JSPDF --> FAST_PNG["fast-png@6.4.0"] JSPDF --> FFLATE["fflate@0.8.2"] JSPDF --> BABEL_RT["@babel/runtime@7.29.2"] JSPDF -.->|optional| CANVG["canvg@3.0.11"] JSPDF -.->|optional| COREJS["core-js@3.49.0"] JSPDF -.->|optional| DOMPURIFY["dompurify@3.3.3"] JSPDF -.->|optional| HTML2CANVAS HTML2CANVAS --> CSS_LB["css-line-break@2.1.0"] HTML2CANVAS --> TEXT_SEG["text-segmentation@1.0.3"] FAST_PNG --> PAKO2["pako@2.1.0\n(duplicate: pako@1.0.11 also exists)"] FAST_PNG --> IOBUFFER["iobuffer@5.4.0"] CANVG --> RAF["raf@3.4.1"] CANVG --> STACKBLUR["stackblur-canvas@2.7.0"] CANVG --> SVG_PATH["svg-pathdata@6.0.3"] CANVG --> RGBCOLOR["rgbcolor@1.0.1"]Prompt To Fix All With AI
Last reviewed commit: "chore: update @anuma..."
Context used: