Skip to content

fix(webapp): make prop-types a production dependency - #4492

Merged
ericallam merged 1 commit into
mainfrom
fix/webapp-prop-types-production-dependency
Aug 3, 2026
Merged

fix(webapp): make prop-types a production dependency#4492
ericallam merged 1 commit into
mainfrom
fix/webapp-prop-types-production-dependency

Conversation

@ericallam

Copy link
Copy Markdown
Member

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.

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.
@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c762309

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread apps/webapp/package.json
Comment thread apps/webapp/package.json
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c6214b3a-57cd-4c98-a1d4-b8c1b826a413

📥 Commits

Reviewing files that changed from the base of the PR and between 8f9db53 and c762309.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • apps/webapp/package.json
📜 Recent review details
⏰ Context from checks skipped due to timeout. (33)
  • GitHub Check: sdk-compat / Node.js 24.18 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 12)
  • GitHub Check: sdk-compat / Node.js 22.23 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-ubuntu-latest-x64-4x - pnpm)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 12)
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-ubuntu-latest-x64-4x - npm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: sdk-compat / Node.js 20.20 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-windows-latest-x64-8x - npm)
  • GitHub Check: sdk-compat / Node.js 26.4 (warp-ubuntu-latest-x64-4x)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: internal / 🧪 Unit Tests: Internal
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-windows-latest-x64-8x - pnpm)
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: runops-guard / runops-guard
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and publish previews
🧰 Additional context used
📓 Path-based instructions (2)
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

When adding Zod, use the exact repository-wide pinned version 3.25.76, never a different version or range.

Files:

  • apps/webapp/package.json
apps/webapp/**/package.json

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

For the webapp, never run pnpm run build --filter webapp to verify changes; use pnpm run typecheck --filter webapp after major changes. Public packages under packages/* use build instead.

Files:

  • apps/webapp/package.json
🧠 Learnings (1)
📚 Learning: 2026-04-27T16:46:03.861Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3456
File: apps/webapp/package.json:152-152
Timestamp: 2026-04-27T16:46:03.861Z
Learning: In `apps/webapp/package.json`, treat the `effect` npm package as an intentional runtime dependency (not unused/misplaced) for the Schedule + Fiber-based metadata update logic. This should apply when reviewing `apps/webapp` code paths used by `apps/webapp/app/utils/updateMetadata.server.ts` (and closely related modules) that use Effect APIs such as `Duration.divide`, `STM.cond`, namespace exports for `Effect`/`Schedule`/`Duration`/`Fiber`, and the `Fiber.RuntimeFiber` type.

Applied to files:

  • apps/webapp/package.json
🔇 Additional comments (1)
apps/webapp/package.json (1)

182-182: LGTM!

Also applies to: 263-263


Walkthrough

The webapp package now declares prop-types under runtime dependencies. The existing version constraint, ^15.8.1, remains unchanged. The duplicate development dependency declaration was removed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes moving prop-types to production dependencies.
Description check ✅ Passed The description clearly explains the production failure, the dependency change, and verification results, but omits the template checklist and screenshots sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/webapp-prop-types-production-dependency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ericallam
ericallam enabled auto-merge (squash) August 3, 2026 16:02
@ericallam
ericallam merged commit 57254b5 into main Aug 3, 2026
52 checks passed
@ericallam
ericallam deleted the fix/webapp-prop-types-production-dependency branch August 3, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants