fix: upgrade vite 6→8 and vitest 3→4 to resolve esbuild CVE - #596
Conversation
Upgrade dev dependencies (notably vite -> ^8.0.0 and vitest -> ^4.0.0) in package.json and regenerate package-lock.json to reflect the updated dependency tree. Adjust tests (tests/setup.ts and tests/memori.test.ts) to be compatible with the updated test tooling and dependency changes.
There was a problem hiding this comment.
Stale comment
Summary
This PR upgrades
memori-tsdev tooling from Vite 6/Vitest 3 to Vite 8/Vitest 4, updates the lockfile, and adjusts a couple of Vitest mocks to work with the new mocking behavior.Findings
Requires changes:
memori-ts/package.json: the package still advertises Node>=20.12.0, but Vite 8 requires^20.19.0 || >=22.12.0, and Vitest now fails to start on Node20.12.0. Please either raise the documented/dev Node floor consistently, includingmemori-ts/README.md, or keep tooling on versions that support the current advertised minimum.Suggestions
npm auditno longer reports the esbuild advisory, but it still reports two moderate transitive advisories forprotobufjsandws. These were already present on the base lockfile at the same versions, so I do not consider them blocking for this PR.Tests
Ran from
memori-ts/on PR head11a4916:
npm cinpm test- 256 passednpm run lintnpm run buildnpm audit --json- exits non-zero for pre-existingprotobufjsandwsadvisoriesnpx -y -p node@20.12.0 node ./node_modules/vitest/vitest.mjs run- fails during Vitest startupnpx -y -p node@20.19.0 node ./node_modules/vitest/vitest.mjs --version- succeedsRecommendation
Requires changes due to the advertised Node compatibility regression.
Sent by Cursor Automation: Memori PR Review
Update minimum Node.js version from 20.12.0 to 20.19.0 in memori-ts/package.json and memori-ts/README.md so the engines field and documentation remain consistent.
There was a problem hiding this comment.
Stale comment
Summary
This PR upgrades
memori-tsdev tooling from Vite 6/Vitest 3 to Vite 8/Vitest 4, regenerates the lockfile, and updates Vitest mocks for constructor compatibility.Findings
Required: The PR raises the published SDK runtime engine to Node
>=20.19.0even though the changed dependency pressure comes from dev-only Vite/Vitest tooling. This changes the install contract for@memorilabs/memori: consumers on Node 20.12-20.18 withengine-strictcan no longer install the package, despite no runtime code or runtime dependencies changing. Please either keep the package/README runtime requirement at the previous supported Node level and document the Node 20.19+ requirement as a development/test tooling requirement, or explicitly treat this as a breaking runtime support change.Suggestions
If the runtime engine bump is intentionally kept, please also regenerate/update the lockfile root package metadata so
memori-ts/package-lock.jsondoes not still advertise>=20.12.0for the root package.
npm audit --jsonno longer reports an installedesbuildpackage, but it still reports two unrelated moderate advisories (protobufjs,ws). That does not block this Vite/Vitest fix, but it is worth tracking separately if the goal becomes a clean audit report.Tests
Ran locally from
memori-ts/:
npm cinpm run typechecknpm test(256 passed)npm run lintnpm run buildnpm audit --jsonObserved CI: CodeQL, Python CI, security, lint/typecheck, Python test matrix, and Linux/macOS TypeScript matrix were passing; Windows TypeScript matrix was still pending at last check.
Recommendation
Requires changes for the Node engine compatibility issue above.
Sent by Cursor Automation: Memori PR Review
Relax the minimum Node.js version from 20.19.0 to 20.12.0. Updated the engines field in memori-ts/package.json and the corresponding note in memori-ts/README.md to reflect the new supported Node.js baseline.
There was a problem hiding this comment.
Stale comment
Summary
This PR upgrades the
memori-tsVite/Vitest dev toolchain and lockfile to remove the resolvedesbuilddependency, and updates the Vitest native-module mocks for the newer runner behavior.Findings
Required change:
memori-ts/package.jsonstill advertises Node>=20.12.0, but the upgraded Vite/Rolldown toolchain requires a newer Node 20 minor. See the inline comment for the concrete failure.Suggestions
- The remaining
npm auditfindings (protobufjs,ws) appear unchanged frommainand come through existing broad provider SDK ranges (@google/genai/openai), so I would treat them as a separate follow-up rather than part of this PR.Tests
Ran locally on PR head
7018bdc:
npm ciinmemori-ts/npm testinmemori-ts/(256 passed)npm run buildinmemori-ts/npm run lintinmemori-ts/npm audit --json/npm explain protobufjs && npm explain wsnpx -y node@20.12.0 node_modules/vitest/vitest.mjs run tests/core/engine.test.ts(fails at startup)npx -y node@20.19.0 node_modules/vitest/vitest.mjs run tests/core/engine.test.ts(passes)Remote CI was mostly green when checked; Windows TS matrix jobs were still in progress.
Recommendation
Requires changes: please align the advertised/dev Node support floor with the upgraded Vite/Vitest toolchain before merging.
Sent by Cursor Automation: Memori PR Review
Update Node.js engine requirement from 20.12.0 to 20.19.0. The change updates memori-ts/package.json and the README to reflect the new minimum Node version. This ensures docs and package metadata stay in sync with the supported runtime.
There was a problem hiding this comment.
Stale comment
Summary
This PR upgrades the
memori-tsVite/Vitest dev toolchain to Vite 8/Vitest 4, refreshes the lockfile to remove the installedesbuildpackage, updates Vitest constructor mocks, and raises the documented Node floor to>=20.19.0.Findings
No required changes found in the current PR head. The earlier Node-floor compatibility issue is resolved by aligning
package.jsonand the README with Vite 8's Node requirement.Suggestions
I left one small inline suggestion: the root package metadata in
memori-ts/package-lock.jsonstill carries the old Node engine value, even thoughpackage.jsonand docs now say>=20.19.0.The remaining
npm auditfindings are two moderate transitive advisories forprotobufjsandws;esbuildis no longer installed, and these findings appear unrelated to this Vite/Vitest change.Tests
Ran locally from
memori-ts/on PR headac470a5:
npm cinpm test- 256 passednpm run typechecknpm run buildnpm run lintnpm audit --jsonnpm install --package-lock-only --ignore-scriptsas a probe, which changed only the stale lockfile engine line; the workspace was restored afterwardGitHub checks that had completed were passing; several OS/Node matrix jobs were still pending when reviewed.
Recommendation
Approved with comments. No blocking merge risks found, pending the remaining CI matrix completing successfully.
Sent by Cursor Automation: Memori PR Review
There was a problem hiding this comment.
Summary
This PR upgrades the memori-ts Vite/Vitest toolchain to Vite 8/Vitest 4, refreshes the lockfile so esbuild is no longer installed, updates Vitest constructor mocks, and aligns the documented/package Node floor at >=20.19.0.
Findings
No required changes found in the current PR head. The prior Node engine and lockfile metadata concerns are addressed in package.json, README.md, and package-lock.json.
Suggestions
npm audit still reports two moderate transitive advisories for protobufjs and ws, but both versions are already present on the base lockfile via existing broad provider SDK ranges (@google/genai / openai). I would track those separately rather than block this Vite/Vitest CVE fix.
Tests
Ran locally from memori-ts/ on PR head 5fc4eced1245e3abe1cec112ff3dfb3df595fd95:
npm cinpm test- 256 passednpm run typechecknpm run buildnpm run lintnpm run format:checkgit diff --check eecb3cf24c25fb3c9bc07e6f5a78ff15aa4e275a...refs/remotes/origin/pr/596npm audit --json- non-zero only for the pre-existingprotobufjsandwsadvisories abovenpx -y -p node@20.19.0 node ./node_modules/vitest/vitest.mjs run tests/core/engine.test.ts- 24 passed
Observed GitHub checks: CodeQL JS/TS and Python completed successfully; CI lint, security, and type-check completed successfully. The OS/Node TypeScript matrix and Python test matrix were still in progress at last refresh.
Recommendation
Approved with comments. No blocking merge risks found, pending the remaining CI matrix completing successfully.
Sent by Cursor Automation: Memori PR Review


Summary
vitefrom^6.4.3to^8.0.0— vite 8 replaces esbuild with rolldown, completely eliminating the vulnerable package from the dependency treevitest,@vitest/coverage-v8, and@vitest/uifrom^3.2.6to^4.0.0to matchvi.fn()mocks used as constructors (new) must usefunctionrather than arrow functions — updatedtests/setup.tsandtests/memori.test.tsTest plan
npm run typecheck— no errorsnpm test— 256/256 tests passnpm audit— esbuild no longer appears in vulnerability report