-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Yes, react-rails 3.2.1 has a known incompatibility with connection_pool ~> 3.0 (default in Bundler/Rails 8+), causing runtime errors during asset compilation/server start due to API changes in ConnectionPool#with block handling.[1]
Root Cause
react-railsinternally usesConnectionPoolfor asset precompilation (Webpack/ESBuild workers).connection_pool 3.xchangedwithsignature (fiber/thread safety);react-rails 3.2.1calls it incorrectly.[2]
Quick Fixes
1. Pin Compatible ConnectionPool (Immediate)
Add to Gemfile:
gem 'connection_pool', '~> 2.4'
bundle update connection_pool
Compatible with react-rails 3.2.1; no code changes. Restart server/assets.[1]
2. Upgrade react-rails (Recommended)
# Gemfile
gem 'react-rails', github: 'reactjs/react-rails' # Latest ~3.3.x
# or wait for 3.3.0 stable
bundle update react-rails
Newer versions fix connection_pool 3.x support. Check changelog.[3]
3. Remove react-rails (Modern Alternative)
Rails 7+ uses jsbundling-rails + shakapacker (esbuild/vite/webpack) for React—no react-rails needed:
# Gemfile
gem 'jsbundling-rails'
gem 'shakapacker' # Webpack for React
# Remove: gem 'react-rails'
rails jsbundling:esbuild # or vite
rails shakapacker:install:webpack
Register components manually via import—cleaner, faster.[3]
Verify Resolution
bundle exec rails s # No connection_pool errors
RAILS_ENV=production bundle exec rails assets:precompile
Pin 2.4 first (safest), upgrade later. Your Devise/STI tests unrelated—this is asset pipeline only.[1]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels