-
-
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
Overriding the Handlebars templates is impossible in production #1567
Comments
Hi @CallMeSH, Curious if you found a workaround/solution to this yet. I've run into the same issue. Thanks. |
Unfortunately no, still waiting for help from the Solidus team. |
I think unfortunately these can't be overridden. Neither can any JS asset. This is a sprockets issue, and is outside our control. This is made extra confusing because dev and production behave differently (due to sprocket's debug setting). Sometimes attempting to override a JS file will result in both the overridden and not overridden file being included. @cbrunsdon has looked into this more than me and might be able to clarify. |
I recently faced a bug on Solidus 1.3.1 related to the backend handlebars templates.
I needed for one of my clients to override the variants suggestions in the autocomplete forms.
I first implemented my override by writing a new template in:
/vendor/assets/javascript/spree/backend/templates/variants/autocomplete.hbs.erb
It worked fine in development but in production, the original template was still in place.
After some research I thought that this would be related to the assets pipeline compilation process and by reading the minified JS I discovered that both versions lived in the same file.
My version of the template is appended all the way at the end of the compiled JS file. Unfortunately, the code binding the template to the variant search form is way higher in the code and call the original template function.
Any ideas how this could be fixed ?
Thanks!
The text was updated successfully, but these errors were encountered: