Skip to content

Commit c762309

Browse files
committed
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.
1 parent 8f9db53 commit c762309

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"prism-react-renderer": "^2.3.1",
180180
"prismjs": "^1.30.0",
181181
"prom-client": "^15.1.0",
182+
"prop-types": "^15.8.1",
182183
"qrcode.react": "^4.2.0",
183184
"random-words": "^2.0.0",
184185
"react": "^18.2.0",
@@ -260,7 +261,6 @@
260261
"npm-run-all": "^4.1.5",
261262
"postcss-import": "^16.0.1",
262263
"postcss-loader": "^8.1.1",
263-
"prop-types": "^15.8.1",
264264
"rimraf": "^6.0.1",
265265
"style-loader": "^3.3.4",
266266
"supertest": "^7.0.0",

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)