Common Errors and Solutions
Solutions to common errors encountered when developing O2VEND themes and apps.
Template Errors
Error: Variable not defined
Problem:
Liquid Error: 'product' is not defined
Solution:
{% if product %}
{{ product.name }}
{% else %}
<p>Product not found</p>
{% endif %}
Error: Filter not found
Problem:
Liquid Error: Unknown filter 'custom_filter'
Solution:
- Check filter name spelling
- Verify filter is registered
- Use
defaultfilter as fallback:
{{ value | custom_filter | default: value }}
Error: Section not found
Problem:
Liquid Error: Section 'header' not found
Solution:
- Verify section file exists:
sections/header.liquid - Check file name matches exactly
- Ensure section is in correct directory
Widget Errors
Error: Widget not rendering
Problem: Widget doesn't appear on page
Solution:
{% if widgets.content.size > 0 %}
{% for widget in widgets.content %}
{% if widget.template_path %}
{% render widget.template_path, widget: widget %}
{% else %}
<p>Widget template not found: {{ widget.type }}</p>
{% endif %}
{% endfor %}
{% endif %}
Error: Widget settings not working
Problem: Widget settings don't apply
Solution:
{{ widget.settings.title | default: 'Default Title' }}
API Errors
Error: 401 Unauthorized
Problem: API request returns 401
Solution:
- Check API key is correct
- Verify API key is in header:
headers: {
'Authorization': `Bearer ${apiKey}`
}
- Check token expiration
Error: 404 Not Found
Problem: API endpoint returns 404
Solution:
- Verify endpoint URL is correct
- Check API version (v1 vs v2)
- Ensure endpoint exists in API specification
Error: 429 Too Many Requests
Problem: Rate limit exceeded
Solution:
- Implement request throttling
- Cache API responses
- Batch multiple requests
- Wait before retrying
Asset Errors
Error: Asset not found
Problem:
Asset 'theme.css' not found
Solution:
- Verify file exists in
assets/directory - Check file name spelling
- Use
asset_urlfilter:
{{ 'theme.css' | asset_url | stylesheet_tag }}
Error: Image not loading
Problem: Images don't display
Solution:
{% if product.image %}
<img src="{{ product.image | img_url: 'large' }}"
alt="{{ product.name | escape }}">
{% else %}
<img src="{{ 'placeholder.png' | asset_url }}" alt="No image">
{% endif %}
App Errors
Error: App not loading
Problem: App doesn't activate
Solution:
- Check
app.jsonsyntax - Verify app structure
- Check for JavaScript errors in console
- Verify hooks are correctly named
Error: Hook not executing
Problem: App hook doesn't run
Solution:
- Verify hook name matches exactly
- Check hook is registered in
app.json - Ensure hook snippet exists
- Check for syntax errors in hook snippet
Debugging Tips
1. Enable Debug Mode
{% if settings.debug_mode %}
<pre>{{ product | json }}</pre>
{% endif %}
2. Check Console
Open browser console to see JavaScript errors
3. Use Liquid Debug
<pre>{{ variable | json }}</pre>
4. Test in Isolation
Test components individually to isolate issues
Getting Help
If you encounter errors not covered here:
- Check the FAQ
- Review Debugging Guide
- Check Known Issues
- Search documentation
- Contact support