Closed pkalisz closed 9 years ago
This is quite a confusing error, since this only happens when the bundle for a template is null
.
I need some more information to help you there.
Thanks in advance
We just ran into the same issue upgrading from Symfony 2.5.8 to 2.5.9. Reverting back to 2.5.8. cured the problem for us.
I've ran into the same issue after accidental upgrade to 2.5.9
I only tested this with 2.6.* will take a look into this.
I'm still not able to reproduce it. Please be so kind and post the following information:
bower.json
composer.json
I think It is related with this PR which was taken into the latest version of 2.3.24, 2.5.9 and the newest 2.6.* branches https://github.com/symfony/symfony/pull/12894
as @stof mentioned in https://github.com/symfony/AsseticBundle/issues/331 there is fix for that in dev version of AsseticBundle
fix for that should be to use only bundle:folder:template.format.engine
notation when including templates
Ah I see. Good to know I didn't broke something :)
in my case the problem was that I used correctly extending main template as
{% extend '::layout.html.twig' %}
but in that file (provided in app/Resources/views/
) i had this code:
{% extends app.user ? "base_secure.html.twig" : "base.html.twig" %}
It works before, now It require to have the bundle notation like
{% extends app.user ? "::base_secure.html.twig" : "::base.html.twig" %}
@davepowell check your code for similar usage
The same problem after updating from 2.5 to 2.6.3 app/console twig:lint src
{% block javascripts %}
{{ parent() }}
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
{% javascripts
'@WorkDefaultBundle/Resources/public/js/chat_client.js'
filter='uglifyjs2' %}
<script src="{{ static_img_url }}{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
globals:
static_img_url: %static_img_url%
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
bundles: [ WorkDefaultBundle, WorkMobileBundle, TwigBundle ]
filters:
uglifyjs2:
bin: /usr/local/bin/uglifyjs
uglifycss:
bin: /usr/local/bin/uglifycss
I think for the {% javascripts %}
tag (and perhaps for {% stylesheets %}
) the only solution is to take the dev version of symfony/assetic bundle (composer require symfony/assetic-bundle:~2.5-dev
) as the change that fix this issue is not yet merged into stable version
Great. Thank you. It works. (and for stylesheets too)
Thank you! Hopefully they merge it in stable soon.
Same issue when update 2.6.1 => 2.6.3 workaround is
"symfony/symfony": "~2.6",
"symfony/assetic-bundle": "dev-master",
Just an observation. I ran into the same problem today (Symfony v2.3.34, Assetic v1.1.1, AsseticBundle v2.3.0), but "resolved" it by using the <Bundle>:<Folder>:<template>
notation for referencing the template (in the controller) instead of @<Bundle>/<Folder>/<template>
.
use the dev version of AsseticBundle (the master branch) to get the fixed version. I will release it this evening
I got the same error after uppgrading from 2.5.8 to 2.5.9, it appears in console when I try to use the translation:update command. Using assetic dev-master version did not fix it (in addition using dev-master versions is considered as a critical violation according to sensio insight)
@ousmaneNdiaye AsseticBundle 2.6.0 and 2.6.1 have been released in the meantime
And I was talking about the AsseticBundle version, not the Assetic version
@stof ok Thank you I will check it out.
@stof, and for the 2.3.* branch ? There are some updates ?
@seb2411 no, because the 2.6 version of AsseticBundle is compatible with Symfony 2.3+ so I'm not maintaining multiple branches in parallel. People should just update to the latest version.
how to upgrade the symfony version
Since this issue is fixed, I'm going to close this ticket
I followed every single step from documentation. Everything works great right after app/console cache:clear, but second request ends with:
My base.html.twig looks like this:
Any ideas what is wrong?