Upgrading to Jinja2 version 2.9 breaks "{{ ASSET_URL }}"
bmjjr opened this issue · comments
Bob Jordan commented
Upgrading from Jinja2 version 2.8.1 to version >= 2.9 seems to break {{ ASSET_URL }} imports for common.css and common.js and now need to be explicit with the paths.
For example, this used to work:
{% assets "css_all" %}
<link type="text/css" href="{{ ASSET_URL }}" rel="stylesheet">
{% endassets %}
{% assets "js_all" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}
Now need explicit paths:
{% assets "css_all" %}
<link rel="stylesheet" href="{{ url_for('static', filename='pub/css/common.css') }}">
{% endassets %}
{% assets "js_all" %}
<script type="text/javascript" src="{{ url_for('static', filename='pub/js/common.js') }}"></script>
{% endassets %}
Cosmo commented
Happening on our end too. Rolling back to 2.8 gave us a quick fix for now
pip install jinja2==2.8
Michael commented
This is related to miracle2k/webassets#477. You need to upgrade webassets to fix it.