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

pmcgovern
  • 71
  • 8
  • what error do you get with --symlink option? – Udan Oct 21 '13 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' % } {% endjavascripts %}` – A.L Oct 21 '13 at 12:59

1 Answers1

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

Community
  • 1
  • 1
Filo
  • 2,829
  • 1
  • 21
  • 36