Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Wildcard problems #177

Open
kix opened this Issue Mar 21, 2013 · 3 comments

Comments

Projects
None yet
3 participants
Contributor

kix commented Mar 21, 2013

In my view I include assets like this:

{% javascripts filter='?yui_js'
'@MyMainBundle/Resources/public/js/jquery.*.js'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

This leads to Assetic throwing an exception:

Unable to find file "@MyMainBundle/Resources/public/js/jquery."

The sequence of scripts is essential to my application so I can't just glob it all into one big * wildcard and I don't really want to waste space including all the libs by hand.

It appears to me that Assetic's wildcards are in fact fake. Am I right?

Member

stof commented Mar 21, 2013

Pleas eprovide the full error message. You truncated both the exception class name and the location of the exception, thus removing 2/3 of the exception description. This makes it quite hard to identify the failing code.

Contributor

kix commented Mar 21, 2013

Here goes:

[1/2] InvalidArgumentException: Unable to find file "@MyMainBundle/Resources/public/js/jquery.".   
[2/2] Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("Unable to find file "@MyMainBundle/Resources/public/js/jquery.".") in "/Users/kix/Sites/mysite/src/My/MainBundle/Resources/views/base.html.twig".  

I am also having this issue, so hopefully me error messages will be of help.

Code used to cause the issue

    {% javascripts output='js/compiled/main.js'
        'js/jquery-1.9.1.js'
        '@AdminBundle/Resources/public/js/bootstrap-*.js' %}
        <script src="{{ asset_url }}" type="text/javascript"></script>
    {% endjavascripts %}

If I use 'AdminBundle/Resources/public/js/bootstrap-*.js' it doesn't error, but doesn't find anything, and if I use '/public/js/bootstrap-affix.js' it works as expected.

Exception detected!
An exception has been thrown during the compilation of a template ("Unable to find file "@AdminBundle/Resources/public/js/bootstrap-".") in "AdminBundle::layout.html.twig".
500 Internal Server Error - Twig_Error_Runtime
1 linked Exception: InvalidArgumentException

[2/2] Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("Unable to find file "@AdminBundle/Resources/public/js/bootstrap-".") in "AdminBundle::layout.html.twig".

[1/2] InvalidArgumentException: Unable to find file "@AdminBundle/Resources/public/js/bootstrap-".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
    INFO - Matched route "admin_homepage" (parameters: "_controller": "Acme\Bundle\ReminderBundle\Controller\DashboardController::indexAction", "_route": admin_homepage")
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
    DEBUG - Read SecurityContext from the session
    DEBUG - Reloading user from user provider.
    DEBUG - SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.salt AS salt6, t0.password AS password7, t0.last_login AS last_login8, t0.locked AS locked9, t0.expired AS expired10, t0.expires_at AS expires_at11, t0.confirmation_token AS confirmation_token12, t0.password_requested_at AS password_requested_at13, t0.roles AS roles14, t0.credentials_expired AS credentials_expired15, t0.credentials_expire_at AS credentials_expire_at16, t0.id AS id17, t0.display_name AS display_name18, t0.about_url AS about_url19 FROM security_admin_users t0 WHERE t0.id = ? LIMIT 1
    DEBUG - Username "dan" was reloaded from user provider.
    DEBUG - Notified event "kernel.request" to listener "Knp\Bundle\PaginatorBundle\Subscriber\SlidingPaginationSubscriber::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener::injectLogger".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener::injectLogger".
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController".
    DEBUG - Notified event "kernel.exception" to listener "Symfony\Component\Security\Http\Firewall\ExceptionListener::onKernelException".
    DEBUG - Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".
    DEBUG - Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ExceptionListener::onKernelException".
    CRITICAL - Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the compilation of a template ("Unable to find file "@AdminBundle/Resources/public/js/bootstrap-".") in "AdminBundle::layout.html.twig"." at /Users/dan/Sites/forgot/app/cache/dev/classes.php line 3004
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Knp\Bundle\PaginatorBundle\Subscriber\SlidingPaginationSubscriber::onKernelRequest".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener::injectLogger".
    DEBUG - Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener::injectLogger".
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController".
    DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController".

I'm using Symfony 2.3 and assetic branch 2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment