Skip to content

Commit edd0463

Browse files
justin808claude
andauthored
Fix CI failures on master (#1940)
## Summary This PR fixes the CI failures on master that were introduced by PR #1934 (smart error messages). ### Changes Made **ESLint Fixes:** - Fixed `@typescript-eslint/no-deprecated` error in `ClientSideRenderer.ts` by adding eslint-disable comment for `unmountComponentAtNode` (React 18 deprecated API that we still need to support for older versions) - Fixed `@typescript-eslint/unbound-method` errors in `createReactOnRailsPro.ts` by adding eslint-disable comments for method references **Test Fixes:** - Updated test expectation in `react_on_rails_helper_spec.rb` to expect `ReactOnRails::SmartError` instead of `ReactOnRails::Error` - Updated error message regex from `/the generated component entrypoint/` to `/Auto-loaded Bundle Missing/` to match the new SmartError format ### Test Plan - ✅ All linting passes locally (`bundle exec rubocop` and `yarn run lint`) - ✅ Specific failing test now passes (`spec/helpers/react_on_rails_helper_spec.rb:128`) - ✅ Pre-commit hooks pass ### Notes - `SmartError` is a subclass of `Error`, so this change maintains backward compatibility - The new error messages are more user-friendly and actionable - All changes align with the smart error messages introduced in PR #1934 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/1940) <!-- Reviewable:end --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 57fb6bf commit edd0463

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

packages/react-on-rails-pro/src/ClientSideRenderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ You should return a React.Component always for the client side entry point.`);
188188
}
189189

190190
try {
191+
// eslint-disable-next-line @typescript-eslint/no-deprecated
191192
unmountComponentAtNode(domNode);
192193
} catch (e: unknown) {
193194
const error = e instanceof Error ? e : new Error('Unknown error');

packages/react-on-rails-pro/src/createReactOnRailsPro.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ export default function createReactOnRailsPro(
145145

146146
if (reactOnRailsPro.streamServerRenderedReactComponent) {
147147
reactOnRailsProSpecificFunctions.streamServerRenderedReactComponent =
148+
// eslint-disable-next-line @typescript-eslint/unbound-method
148149
reactOnRailsPro.streamServerRenderedReactComponent;
149150
}
150151

151152
if (reactOnRailsPro.serverRenderRSCReactComponent) {
152153
reactOnRailsProSpecificFunctions.serverRenderRSCReactComponent =
154+
// eslint-disable-next-line @typescript-eslint/unbound-method
153155
reactOnRailsPro.serverRenderRSCReactComponent;
154156
}
155157

spec/dummy/spec/helpers/react_on_rails_helper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def helper.append_javascript_pack_tag(name, **options)
128128
it "throws an error in development if generated component isn't found" do
129129
allow(Rails.env).to receive(:development?).and_return(true)
130130
expect { helper.load_pack_for_generated_component("nonexisting_component", render_options) }
131-
.to raise_error(ReactOnRails::Error, /the generated component entrypoint/)
131+
.to raise_error(ReactOnRails::SmartError, /Auto-loaded Bundle Missing/)
132132
end
133133
end
134134

0 commit comments

Comments
 (0)