studio/frontend: drop unused next dependency#5438
Conversation
The frontend is a Vite SPA wrapped by Tauri and served by FastAPI's StaticFiles in web mode. Nothing in src imports from next/, no next.config exists, and no script invokes the Next.js server. The package was dead weight in node_modules and was being flagged by SCA scanners under CVE-2026-44578 (Next.js SSRF via WebSocket upgrade) despite the vulnerable code path never being reachable. next-themes is unrelated and stays; its only peers are react and react-dom. Verified with npm install + npm run build (tsc -b && vite build), clean exit, dist/ produced as before.
There was a problem hiding this comment.
Code Review
This pull request removes the next dependency and its associated transitive packages from the frontend project. A review comment identified an inconsistency where @tanstack/react-router was updated in the lockfile but not in the project's manifest, and suggested reverting this change to maintain consistency.
| "@streamdown/mermaid": "1.0.2", | ||
| "@tailwindcss/vite": "^4.2.2", | ||
| "@tanstack/react-router": "^1.159.10", | ||
| "@tanstack/react-router": "1.169.2", |
There was a problem hiding this comment.
The update to @tanstack/react-router in package-lock.json (from ^1.159.10 to 1.169.2) is inconsistent with package.json, which was not updated in this pull request. This results in the lockfile being out of sync with the project manifest. Additionally, this change appears unrelated to the primary goal of removing the next dependency.
If this upgrade was intentional, please update package.json to match. Otherwise, please revert this change to maintain consistency and keep the PR focused.
| "@tanstack/react-router": "1.169.2", | |
| "@tanstack/react-router": "^1.159.10", |
There was a problem hiding this comment.
This review is reversed. package.json already pins "@tanstack/react-router": "1.169.2" (literal, no caret) on main; the previous commit bbd0ba0 introduced that pin. The lockfile's root dep-map at line 36 was stale at "^1.159.10" while node_modules/@tanstack/react-router was already resolving to 1.169.2. npm install resynced the spec string to match the manifest, which is the correct direction.
Reverting to ^1.159.10 would re-introduce the manifest/lockfile drift and break npm ci.
Evidence (git output, this PR's tree):
package.json line 44 (main and this branch, unchanged):
"@tanstack/react-router": "1.169.2",
package.json line 87 (overrides block, unchanged):
"@tanstack/react-router": "1.169.2",
package-lock.json line 36 BEFORE this PR:
"@tanstack/react-router": "^1.159.10", # stale, did not match manifest
package-lock.json line 36 AFTER this PR:
"@tanstack/react-router": "1.169.2", # now matches manifest
node_modules/@tanstack/react-router (installed version):
1.169.2 -- same before and after this PR
git --no-pager diff main...studio/drop-unused-next-dep -- studio/frontend/package.json shows the only change to package.json in this PR is the removed next entry. No tanstack lines were touched in the manifest.
Security clearance for the installed versions, given GHSA-g7cv-rxg3-hmpx (Mini Shai-Hulud, May 11 2026):
| Package | Installed | Compromised versions | Status |
|---|---|---|---|
@tanstack/react-router |
1.169.2 | 1.169.5, 1.169.8 | clean (precedes both) |
@tanstack/router-core |
1.169.2 | 1.169.5, 1.169.8 | clean (precedes both) |
@tanstack/history |
1.161.6 | 1.161.9, 1.161.12 | clean (precedes both) |
npm audit on the new lockfile reports zero tanstack vulnerabilities. GHSA-9m65-766c-r333 only affects @tanstack/start-server-core, which this project does not use.
Leaving the lockfile resync in.
Summary
nextfromstudio/frontend/package.json(and its transitive subtree frompackage-lock.json).StaticFilesin web mode. The Next.js package was an unused dependency.What got removed from the lockfile (42 packages, all Next.js transitives)
next,@next/env@next/swc-*platform binaries@swc/helpers,client-only,styled-jsx(Next-only CSS-in-JS)sharp+@img/sharp-*+ libvipsnext/imagefor server-side image optimization (10 sharp binaries + 13 libvips binaries +@img/colour+ sharp's nestedsemver)postcss(top-level)nanoid. Tailwind v4 via@tailwindcss/viteruns its own pipeline and does not need top-levelpostcss.31 of the 42 entries are just per-platform native binary wrappers, which is why the diff looks bigger than the actual surface change.
About the lone
+1The single inserted line is npm resyncing the root-package dep map in
package-lock.jsonto match whatpackage.jsonalready declares:package.jsonalready pins this to"1.169.2"(and also lists it inoverrides). The lockfile's root dep map was stale at"^1.159.10", while the installed entrynode_modules/@tanstack/react-routerwas already on1.169.2.npm installcorrected the spec string to match. Installed version is identical before and after; no runtime behavior change.Why this is safe
src/has zerofrom "next/..."imports. The onlynext-prefixed import isnext-themes, which is a separate package whose peer deps are justreactandreact-dom.src/also has zerofrom "sharp",from "postcss", orfrom "styled-jsx"imports.next.config.{js,ts,mjs}exists.package.jsonscripts arevite,tsc -b && vite build,eslint,vite preview,tsc -b,biome check. None invokenext start,next dev, ornext build.vite.config.tsuses@vitejs/plugin-reactand@tailwindcss/vite. No Next plugin.components.json(shadcn) has"rsc": false, confirming this is not a Next/RSC project.package-lock.jsonshows only the root package listednextas a dep. Nothing transitive needed it.tauri.conf.jsonpointsfrontendDistat../frontend/dist(Vite's output) anddevUrlat port5173(Vite's default).beforeDevCommandandbeforeBuildCommandshell out tonpm run dev/npm run build, both of which are Vite scripts.Cargo.tomlhas no Next bindings.dist/viaapp.mount("/assets", StaticFiles(...))and a catch-allserve_frontendroute instudio/backend/main.py. The Next.js Node server was never instantiated at runtime.Related security note
This also clears the noise from SCA scanners flagging the lockfile under CVE-2026-44578 (Next.js SSRF via WebSocket upgrade, fixed in 15.5.16 and 16.2.5). The vulnerable code path is only reachable when the Next.js Node server is actually serving requests, which is not the case in Studio, but the dependency entry kept the warning live.
Test plan
npm installsucceeds,node_modules/nextno longer present,node_modules/next-themespreserved.npm run build(tsc -b && vite build) completes with exit 0,dist/produced.dist/assets/index-*.css(356K) anddist/assets/data-recipes-*.css(16K) emitted by Tailwind v4../install.sh --local --no-torchruns end to end with exit 0, all 10 setup steps green, llama.cpp prebuilt installed.unsloth studio -H 127.0.0.1boots, default admin account is created, server reportsApplication startup completeandFrontend loaded from .../studio/frontend/dist.GET /returns 200text/htmlGET /assets/index-Cv0kvyjR.jsreturns 200, 3,628,414 bytes (main bundle, byte-for-byte match withdist/)GET /assets/index-mOHsBWzF.cssreturns 200, 363,441 bytes (Tailwind v4 output)index.htmlreturn 200GET /api/healthreturns 200{"status":"healthy"}importlib.util.find_spec("next")andfind_spec("next_themes")both returnNonein the installed venv (Python side is untouched, as expected).studio-frontend-cigreen.release-desktopworkflow if triggered.