Title: fix(webapp): make prop-types a production dependency by ericallam · Pull Request #4492 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: fix(webapp): make prop-types a production dependency by ericallam · Pull Request #4492 · triggerdotdev/trigger.dev
X Title: fix(webapp): make prop-types a production dependency by ericallam · Pull Request #4492 · triggerdotdev/trigger.dev
Description: Summary The webapp's server bundle imports prop-types directly, but the package was declared only as a devDependency. A production install therefore leaves it out and the built server fails to boot: Failed to start server: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'prop-types' imported from /triggerdotdev/apps/webapp/build/server/assets/server-build-*.js Moving it to dependencies is the whole change. Why the bundle imports it Nothing in the webapp's own code uses prop-types — there is no reference to it, or to PropTypes, anywhere under apps/webapp/app. It arrives through recharts, whose react-smooth dependency still declares propTypes on its components. That was invisible until recently. While recharts was resolved at runtime, its prop-types import was satisfied inside recharts' own dependency tree, which is production all the way down. #4486 added recharts and victory-vendor to ssr.noExternal to fix a hydration mismatch on every server-rendered chart; that inlines react-smooth into the server bundle, which moves its prop-types import into the webapp's own resolution scope — where the package was not available in production. So the bundling change was correct about which d3-shape build both sides resolve, and wrong about what the production runtime would be able to find. Verification docker/Dockerfile builds the runtime dependencies with pnpm install --prod against a turbo prune --scope=webapp --docker output, so I reproduced exactly that: pruned the workspace, installed with --prod, and imported prop-types from apps/webapp. result main as it stands (devDependency only) FAILS: ERR_MODULE_NOT_FOUND with this change prop-types resolves OK It resolves both as a CommonJS require and as an ESM import, which is the form the bundle uses. I also checked this is not one symptom of a wider problem: of the 169 bare specifier roots the server bundle imports, prop-types is the only one that is a devDependency and not a production dependency. The rest are node builtins or production dependencies. The hydration fix from #4486 is unaffected — the rebuilt bundle still carries the rounding d3-path build. Notes prop-types is inert in production (its entry point swaps in factoryWithThrowingShims), so this adds a 124 KB package that does no work at runtime. It has to be resolvable regardless, because the import is real. An alternative would be adding prop-types to ssr.noExternal so it is inlined and needs no runtime resolution. That keeps the dependency list honest about the fact that the webapp itself does not use it, at the cost of bundling a CommonJS package into the ESM server output. This route is the smaller, better-understood change. Worth following up separately: a check that every bare import in the server bundle resolves from a production install would have caught this before it landed. Local development installs every devDependency, so the gap is invisible when the built server is run from a working tree.
Open Graph Description: Summary The webapp's server bundle imports prop-types directly, but the package was declared only as a devDependency. A production install therefore leaves it out and the built server fails to ...
X Description: Summary The webapp's server bundle imports prop-types directly, but the package was declared only as a devDependency. A production install therefore leaves it out and the built server fails...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4492
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cc38445f-cae7-7a9a-b96c-41ae73adca65 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A194:29CAD0:72535D:A933D4:6AFAF655 |
| html-safe-nonce | e7ee97e8ff89f4137e0be6fb9c314bb3782fdd05d3ed7af83b75c69f637a1f63 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTk0OjI5Q0FEMDo3MjUzNUQ6QTkzM0Q0OjZBRkFGNjU1IiwidmlzaXRvcl9pZCI6IjUzNTE5ODM3NjIyMDM1ODIyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 54be41f00b52bfeb4f80a374b9cd62a2dadb32b7dee5ee3fcc920f0ccdcdbaa0 |
| hovercard-subject-tag | pull_request:4195958412 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4492/files |
| twitter:image | https://avatars.githubusercontent.com/u/534?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/534?s=400&v=4 |
| og:image:alt | Summary The webapp's server bundle imports prop-types directly, but the package was declared only as a devDependency. A production install therefore leaves it out and the built server fails to ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a85e96a83bed7871993e6b1ffda24105928eee17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width