fix: upgrade vite to 7.3.1 to resolve esbuild vulnerability#149
Merged
fix: upgrade vite to 7.3.1 to resolve esbuild vulnerability#149
Conversation
Bump vite 7.1.12 → 7.3.1 and @vitejs/plugin-react 5.1.0 → 5.1.4, which upgrades the transitive esbuild dependency from 0.25.11 to 0.27.3 (>= 0.27.2 required).
danielmillerp
approved these changes
Feb 18, 2026
Collaborator
danielmillerp
left a comment
There was a problem hiding this comment.
yeah sure why not
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| "typescript": "5.9.2", | ||
| "uuid": "^11.1.0" | ||
| "uuid": "^11.1.0", | ||
| "vite": "^7.3.1" |
There was a problem hiding this comment.
vite should be in devDependencies, not dependencies
This is a Next.js application — vite is not used at runtime (the build/dev scripts use next build / next dev --turbopack). Vite is only needed as a transitive dependency of vitest (which is already in devDependencies). Placing it in production dependencies causes esbuild and all its platform-specific binaries (~26 packages) to lose their "dev": true flag in the lockfile, unnecessarily bloating production installs.
Move vite to devDependencies alongside vitest and @vitejs/plugin-react:
Suggested change
| "vite": "^7.3.1" | |
| "uuid": "^11.1.0" | |
| }, | |
| "devDependencies": { | |
| "@eslint/eslintrc": "^3.3.1", | |
| "@testing-library/jest-dom": "^6.9.1", | |
| "@testing-library/react": "^16.3.0", | |
| "@testing-library/user-event": "^14.6.1", | |
| "@types/node": "^20", | |
| "@types/react": "^19", | |
| "@types/react-dom": "^19", | |
| "@types/react-syntax-highlighter": "^15.5.13", | |
| "@vitejs/plugin-react": "^5.1.4", | |
| "@vitest/coverage-v8": "^4.0.6", | |
| "@vitest/ui": "^4.0.6", | |
| "eslint": "9.32.0", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: agentex-ui/package.json
Line: 54:54
Comment:
**`vite` should be in `devDependencies`, not `dependencies`**
This is a Next.js application — `vite` is not used at runtime (the build/dev scripts use `next build` / `next dev --turbopack`). Vite is only needed as a transitive dependency of `vitest` (which is already in `devDependencies`). Placing it in production `dependencies` causes `esbuild` and all its platform-specific binaries (~26 packages) to lose their `"dev": true` flag in the lockfile, unnecessarily bloating production installs.
Move `vite` to `devDependencies` alongside `vitest` and `@vitejs/plugin-react`:
```suggestion
"uuid": "^11.1.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/react-syntax-highlighter": "^15.5.13",
"@vitejs/plugin-react": "^5.1.4",
"@vitest/coverage-v8": "^4.0.6",
"@vitest/ui": "^4.0.6",
"eslint": "9.32.0",
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vitefrom 7.1.12 to 7.3.1 and@vitejs/plugin-reactfrom 5.1.0 to 5.1.4Test plan
npm ls esbuildshows >= 0.27.2npm run buildto confirm no build regressionsnpm run devto confirm dev server worksGreptile Summary
This PR upgrades
vitefrom 7.1.12 to 7.3.1 and@vitejs/plugin-reactfrom 5.1.0 to 5.1.4 to resolve an esbuild vulnerability (upgrading from 0.25.11 to 0.27.3). The security fix is valid and the version bumps look correct.viteadded to productiondependenciesinstead ofdevDependencies— This is a Next.js app that only uses vite through vitest for testing. Addingviteas a production dependency causes esbuild and ~26 platform-specific binary packages to be installed in production, increasing image size and attack surface. It should be moved todevDependencies.@vitejs/plugin-reactupgrade from 5.1.0 to 5.1.4 indevDependenciesis correctly placed.Confidence Score: 2/5
vitein productiondependenciesinstead ofdevDependenciesis a meaningful error for a Next.js app. It won't break anything, but it will unnecessarily include vite, esbuild, and dozens of platform binaries in production installs, increasing image size and attack surface — counterproductive for a security-motivated PR.agentex-ui/package.json—viteneeds to be moved fromdependenciestodevDependenciesImportant Files Changed
@vitejs/plugin-reactto 5.1.4, but incorrectly addsviteto productiondependenciesinstead ofdevDependencies, causing esbuild and its platform binaries to be marked as production dependencies.@esbuild/*packages lost their"dev": trueflag becausevitewas added as a production dependency.Flowchart
flowchart TD A[package.json] -->|dependencies| B[vite ^7.3.1] B -->|requires| C[esbuild ^0.27.0] C -->|installs| D["@esbuild/* platform binaries (26 packages)"] A -->|devDependencies| E["@vitejs/plugin-react ^5.1.4"] A -->|devDependencies| F[vitest ^4.0.6] F -->|peer dependency| B style B fill:#ff9999,stroke:#cc0000 style C fill:#ff9999,stroke:#cc0000 style D fill:#ff9999,stroke:#cc0000 style E fill:#99ff99,stroke:#00cc00 style F fill:#99ff99,stroke:#00cc00Last reviewed commit: fe5ee1a