Skip to content

Commit 2f26987

Browse files
justin808claude
andcommitted
Fix React 19 server bundle errors by removing 'use client' from .server.tsx files
Files ending with .server.tsx are intended for server-side rendering and should not have the 'use client' directive. This directive causes webpack to bundle these files as client components, which leads to errors when React 19's server exports don't include client-only APIs like createContext, useContext, and Component. This fixes CI errors: - export 'createContext' was not found in 'react' - export 'useContext' was not found in 'react' - export 'Component' was not found in 'react' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent cb444c4 commit 2f26987

File tree

3 files changed

+0
-6
lines changed

3 files changed

+0
-6
lines changed

react_on_rails_pro/spec/dummy/client/app/ror-auto-load-components/AsyncOnServerSyncOnClient.server.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import wrapServerComponentRenderer from 'react-on-rails-pro/wrapServerComponentRenderer/server';
42
import AsyncOnServerSyncOnClient from '../components/AsyncOnServerSyncOnClient';
53

react_on_rails_pro/spec/dummy/client/app/ror-auto-load-components/LazyApolloGraphQLApp.server.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import React from 'react';
42
import { renderToString } from 'react-dom/server';
53
import { getMarkupFromTree } from '@apollo/client/react/ssr';

react_on_rails_pro/spec/dummy/client/app/ror-auto-load-components/ServerComponentRouter.server.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import * as React from 'react';
42
import { StaticRouter } from 'react-router-dom/server.js';
53
import { RailsContext, ReactComponentOrRenderFunction } from 'react-on-rails-pro';

0 commit comments

Comments
 (0)