-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
either width or height must be specified #5649
Comments
bump, same error here using Desktop (please complete the following information):
Additional context
Comments: |
Alright this issue resolved itself once I updated ruby to 3.3.0 with rvm @SamuelBonilla |
Hey @SamuelBonilla I had a quick look at this issue and I believe what you describe is more related to the |
bump, same problem after fresh installation |
Same problem here. Ruby 3.3.0. Looks like seeded demo product images causes this failure. With all of the demo products removed and new products added everything works fine. Did not dig deeper yet to see what's wrong - the images itself are loading fine and are visible in admin backend. |
This is weird .. inside file app/components/image_component.rb I just replaced the size variable with constant when I was debugging.
And everything worked fine !! |
@nvandoorn The height/width should be coming from our code though, right? That's why @asfour75's change fixes it. |
After further debugging .. the size variable passed to image_component.rb: While this line: size variable can accept only: So I changed any value with 'big' -> 'product' and 'full' -> 'large' Maybe the error message was misleading .. |
Hey folks someone submitted a patch here (solidusio/solidus_starter_frontend#369) which seems to address the issue. @asfour75 would you be able to confirm it fixes your issue? |
@nvandoorn I'm still facing the same issue even after the patch. I had to follow @asfour75 to make it work. Edit: After updating ruby version from 3.2.2 to 3.3.5 the problem resolved! |
still a problem even if upgrading to ruby 3.3.5 |
For those of you still having issues, I am wondering if you're able to provide more context about what you've done to try and reconcile the issue. @nvandoorn indicated there's a fix in
|
Solidus Version:
To Reproduce
Steps to reproduce the behavior:
bundle add solidus
bin/rails g solidus:install
image_tag
helper method.size
parameter.Current behavior
When attempting to use
image_tag
helper without specifying either a width or height in thesize
parameter, an error is produced stating that either width or height must be specified. This occurs even though the application's logic should provide a default or extract the size to ensure at least one dimension is present.Extracted source (around line #15):
Expected behavior
The application should either provide a default size if none is given or handle the absence of dimensions without raising an error, allowing for graceful degradation or a fallback to a default placeholder.
Screenshots
Desktop (please complete the following information):
Additional context
image_tag
helper is not handling the absence of a specified size gracefully. It seems to be an oversight in either the application's code or a library that the application is using.The text was updated successfully, but these errors were encountered: