This guide covers common issues and solutions when using Spree Product Reviews & Ratings with Spree 5.
window.ActiveStorage is undefined or import errors like:
Uncaught TypeError: Failed to resolve module specifier "@rails/activestorage".
Precompile assets in production:
RAILS_ENV=production bin/rails assets:precompile
Clear browser cache if scripts are cached.
Uncaught (in promise) AbortError: The user aborted a request.
-
Usually harmless if a Turbo request is canceled when navigating away.
-
Ensure all form_with or AJAX forms have correct data-controller and data-target attributes.
-
Check console for failed network requests and ensure server responds with 200/204 status codes.
Large images or files fail to upload.
- Update nginx.conf:
server {
listen 443 ssl http2;
server_name example.com;
client_max_body_size 25M; # Add/Modify This to use 25MB
location / {
proxy_pass http://spree_app;
...
}
}
- Reload Nginx:
docker compose exec nginx nginx -s reload
After installing spree_product_reviews, the Review block does not show in Product Details.
- Ensure PageSection has the Reviews block:
Spree::PageSection
.where(type: "Spree::PageSections::ProductDetails")
.find_each do |section|
unless section.blocks.where(type: "Spree::PageBlocks::Products::Reviews").exists?
section.blocks.create!(
type: "Spree::PageBlocks::Products::Reviews",
position: section.blocks.maximum(:position).to_i + 1
)
end
end
- Clear cache and restart the server.
Product reviews not reflected in Google Rich Results.
-
Ensure _json_ld.html.erb is copied to your active theme:
app/views/themes/<your_theme>/spree/products/_json_ld.html.erb -
Check your product page in:
JavaScript or images not loading correctly.
- Recompile assets:
RAILS_ENV=development bin/rails assets:precompile - Restart containers or Foreman:
foreman start -f Procfile.dev # or docker compose up -d
-
Always restart Rails server after migrations or asset precompilation.
-
Use rails c to verify blocks and sections:
Spree::PageSection.first.blocks.pluck(:type, :position) -
Clear caches in production:
bin/rails tmp:cache:clear -
Monitor log/production.log or docker logs for errors.