2

I am using Assetic within a twig template to specify 2 JS files to utilize from my bundle

{
    % javascripts
        '@JiraExtendedReportsBundle/Resources/public/js/jquery-2.0.3.min.js'
        '@JiraExtendedReportsBundle/Resources/public/js/jquery.jqplot.min.js'
    %
}

When running assetic:dump and then assets:install, it creates the two files (without errors), but the second one is empty, even though it has contents within my bundle.

I've ensured that I have write access to web/bundles. I've tried the --symlink option, which errors out.

What steps can I take to debug/fix this?

Update: I just looked into web/bundles/jiraextendedreports/js and it's not creating an empty file for the second file, it's not creating a file at all. I've tried downgrading to symfony 2.3.3 and 2.3.2 (from 2.3.6) with no change - I got the idea from this thread: https://github.com/kriswallsmith/assetic/issues/496, but it does not seem to apply to me

2
  • what error do you get with --symlink option? Commented Oct 21, 2013 at 12:51
  • Did you forgot the end of the tag ? { % javascripts '@JiraExtendedReportsBundle/Resources/public/js/jquery-2.0.3.min.js' '@JiraExtendedReportsBundle/Resources/public/js/jquery.jqplot.min.js' % } <script src="{{ asset_url }}"></script> {% endjavascripts %} Commented Oct 21, 2013 at 12:59

1 Answer 1

1
{% javascripts
        '@JiraExtendedReportsBundle/Resources/public/js/jquery-2.0.3.min.js' 
        '@JiraExtendedReportsBundle/Resources/public/js/jquery.jqplot.min.js'
    %}
         <script src="{{ asset_url }}" type="text/javascript"></script>
{% endjavascripts %}

reference:
http://symfony.com/doc/current/cookbook/assetic/asset_management.html#including-javascript-files

In Dev:

php app/console cache:clear
php app/console assets:install
php app/console assetic:dump

In Production:

php app/console cache:clear --env=prod --no-debug
php app/console assets:install #not always necessary
php app/console assetic:dump --env=prod --no-debug

reference:
http://symfony.com/doc/current/cookbook/deployment/tools.html#common-post-deployment-tasks
https://stackoverflow.com/a/22875441/3625883

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.