-
-
Notifications
You must be signed in to change notification settings - Fork 638
Closed
Description
Problem
The React on Rails installer is generating config/shakapacker.yml with incorrect compile settings, causing unnecessary "Slow setup for development" warnings when using Procfiles with bin/dev.
Current Behavior
The generated shakapacker.yml has:
development:
<<: *default
compile: true # ❌ Wrong - causes on-demand compilationThis causes Rails to attempt on-demand asset compilation even when bin/shakapacker-dev-server or bin/shakapacker --watch are running via Procfiles, resulting in this warning on every request:
Shakapacker::Compiler - Slow setup for development
Prepare JS assets with either:
1. Running bin/shakapacker-dev-server
2. Set compile to false in shakapacker.yml and run bin/shakapacker -w
Expected Behavior
The correct configuration should be:
default: &default
# ... other settings ...
compile: false # Default is false (use Procfiles)
development:
<<: *default
# Inherits compile: false - no on-demand compilation
test:
<<: *default
compile: true # Only tests need on-demand compilation
production:
<<: *default
compile: false # Assets are precompiledImpact
- Developers see unnecessary warnings on every page load
- Confusion about whether the dev server is working correctly
- Potential performance impact from Rails attempting compilation checks
Environment
- React on Rails: 16.1.1
- Shakapacker: 9.x (from GitHub main)
- Rails: 8.0.3
Suggested Fix
Update the installer template for shakapacker.yml to:
- Set
compile: falsein thedefaultsection - Remove
compile: truefromdevelopmentsection (let it inherit) - Keep
compile: trueonly intestsection
Related Files
This appears to affect the installer generator template, likely in:
lib/generators/react_on_rails/install/templates/base/config/shakapacker.yml
Reproduction
- Run react_on_rails installer to create a new demo
- Run
bin/dev(which starts rails server + shakapacker-dev-server) - Visit any page
- Observe "Slow setup for development" warning in logs
References
Found while working on: shakacode/react_on_rails-demos#20
Metadata
Metadata
Assignees
Labels
No labels