Skip to content

Commit 5d85f15

Browse files
justin808claude
andcommitted
Fix SSR by using classic React runtime in SWC
The automatic React runtime was causing issues with React on Rails server-side rendering. Switching to classic runtime ensures compatibility with React on Rails SSR function detection. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 087ec70 commit 5d85f15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

config/swc.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const customConfig = {
1010
loose: false,
1111
transform: {
1212
react: {
13-
// Use automatic runtime (React 17+) - no need to import React
14-
runtime: 'automatic',
13+
// Use classic runtime for better SSR compatibility with React on Rails
14+
runtime: 'classic',
1515
// Enable React Fast Refresh in development
1616
refresh: env.isDevelopment && env.runningWebpackDevServer,
1717
},

0 commit comments

Comments
 (0)