From c762309dcb0a8a2ff17a5247de615e3f96516f4c Mon Sep 17 00:00:00 2001 From: Eric Allam Date: Mon, 3 Aug 2026 16:59:25 +0100 Subject: [PATCH] fix(webapp): make prop-types a production dependency The server bundle imports prop-types directly, so it has to be present in a production install. It was declared only as a devDependency, so `pnpm install --prod` leaves it out and the built server fails to boot with ERR_MODULE_NOT_FOUND on startup. Nothing in the webapp's own code imports it. It arrives through recharts, whose react-smooth dependency declares propTypes on its components. That used to be invisible here: while recharts was resolved at runtime, the import was satisfied inside recharts' own dependency tree. #4486 added recharts to `ssr.noExternal` to fix a hydration mismatch, which inlines react-smooth into the server bundle and moves its prop-types import into the webapp's own resolution scope, where the package was not available in production. Verified by pruning the workspace the way docker/Dockerfile does and running `pnpm install --prod` against it: importing prop-types from the webapp fails with ERR_MODULE_NOT_FOUND before this change and resolves after. It is the only devDependency-only bare import in the server bundle, out of 169 specifiers. --- apps/webapp/package.json | 2 +- pnpm-lock.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/webapp/package.json b/apps/webapp/package.json index 849db7fc773..42900ea2f55 100644 --- a/apps/webapp/package.json +++ b/apps/webapp/package.json @@ -179,6 +179,7 @@ "prism-react-renderer": "^2.3.1", "prismjs": "^1.30.0", "prom-client": "^15.1.0", + "prop-types": "^15.8.1", "qrcode.react": "^4.2.0", "random-words": "^2.0.0", "react": "^18.2.0", @@ -260,7 +261,6 @@ "npm-run-all": "^4.1.5", "postcss-import": "^16.0.1", "postcss-loader": "^8.1.1", - "prop-types": "^15.8.1", "rimraf": "^6.0.1", "style-loader": "^3.3.4", "supertest": "^7.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f37e3250982..45163c161bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -668,6 +668,9 @@ importers: prom-client: specifier: ^15.1.0 version: 15.1.0 + prop-types: + specifier: ^15.8.1 + version: 15.8.1 qrcode.react: specifier: ^4.2.0 version: 4.2.0(react@18.3.1) @@ -906,9 +909,6 @@ importers: postcss-loader: specifier: ^8.1.1 version: 8.1.1(postcss@8.5.15)(typescript@6.0.3)(webpack@5.102.1(@swc/core@1.3.26)(esbuild@0.15.18)) - prop-types: - specifier: ^15.8.1 - version: 15.8.1 rimraf: specifier: ^6.0.1 version: 6.0.1