Skip to content

Commit 27df4bc

Browse files
committed
Fix React on Rails config to use proper server_bundle_output_path
Use the correct React on Rails 16+ config option 'server_bundle_output_path' instead of incorrect 'server_bundle_js_file_path'. The server_bundle_js_file should remain just the filename, not a full path.
1 parent 68092cf commit 27df4bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

config/initializers/react_on_rails.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
# If you are never using server rendering, you may set this to "".
1313
# If you are using the same file for client and server rendering, having this set probably does
1414
# not affect performance.
15-
# Server bundle is now in a private directory (not in public/)
16-
config.server_bundle_js_file = Rails.root.join("app", "assets", "builds", "server-bundle.js").to_s
15+
config.server_bundle_js_file = "server-bundle.js"
16+
17+
# Server bundle output path for private SSR bundles (React on Rails 16+)
18+
# This keeps server bundles separate from public assets for security
19+
config.server_bundle_output_path = "app/assets/builds"
1720

1821
# React on Rails 16 compatibility: Workaround for removed error handling
1922
#

0 commit comments

Comments
 (0)