Fixed comments-ui iframe React type errors#28935
Conversation
no ref comments-ui has TypeScript source files but did not declare React type packages locally, so direct tsc checks could not resolve React class component members like forceUpdate and props.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ref TryGhost#28935 comments-ui still uses the React 17 catalog at runtime, so its direct React type dependencies should come from the same catalog instead of the default React 18 type packages.
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin-x-settings:test:acceptance |
✅ Succeeded | 10m 27s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | 2s | View ↗ |
nx run-many -t test:unit -p @tryghost/comments-... |
✅ Succeeded | 8m 31s | View ↗ |
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 37s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 2m 42s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 4m 26s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 2m 48s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 2m 30s | View ↗ |
Additional runs (7) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-06-26 16:49:22 UTC
ref TryGhost#28935 The PR needs a new comments-ui package version above the current main version after the rebase.
9larsons
left a comment
There was a problem hiding this comment.
Hey, sorry for the merge noise. Concurrent /apps/ PRs all fight over the package.json version bump check in CI... we need a better solution for that.
The way you had this was going to use the React 18 types when comments is on React 17, so I made an adjustment to the catalog entries. 👍
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28935 +/- ##
==========================================
+ Coverage 74.34% 74.37% +0.02%
==========================================
Files 1559 1559
Lines 135002 135002
Branches 16403 16408 +5
==========================================
+ Hits 100362 100402 +40
+ Misses 33613 33573 -40
Partials 1027 1027
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for fixing that. I missed that comments-ui is still on the React 17 catalog, so it makes sense for the React type packages to use |

Why I am making it
This clears all TypeScript errors from
apps/comments-ui/src/components/iframe.tsx.The original error made it look like
this.forceUpdate()was the problem, but the same pattern exists elsewhere in the codebase without triggering that error. By comparison, the missing piece in comments-ui was that the package did not declare React type dependencies locally, so TypeScript could not understand thatIFrameextendsReact.Componentand therefore has inherited members likeforceUpdateandprops.What it does
Adds
@types/reactand@types/react-domto comments-ui using the existing pnpm catalog, and refreshes the lockfile importer entries.Why developers need it
This cleans up the type-checking path for comments-ui so developers see the real remaining package type issues instead of misleading React declaration and class inheritance errors in
iframe.tsx.Errors no longer present
Running
node_modules/.bin/tsc -p apps/comments-ui/tsconfig.json --noEmit --pretty falseno longer reports any errors fromapps/comments-ui/src/components/iframe.tsx, including:Could not find a declaration file for module 'react'Could not find a declaration file for module 'react-dom'Property 'forceUpdate' does not exist on type 'IFrame'Property 'props' does not exist on type 'IFrame'JSX element class does not support attributes because it does not have a 'props' property'IFrame' cannot be used as a JSX componentTesting
node_modules/.bin/tsc -p apps/comments-ui/tsconfig.json --noEmit --pretty falseThis still fails on existing unrelated comments-ui strict TypeScript errors, but none are in
apps/comments-ui/src/components/iframe.tsx.Checklist