Error Add myBundle to the asseticBundle config symfony2 exception

0 votes

When I am trying to use the TWIG {% javascript %} tag to link to my .js file it return me with the following exception :

An exception has been thrown during the compilation of a template ("You must add CompetitiongameBundle to the assetic.bundle config to use the {% javascripts %} tag in CompetitiongameBundle:game:index.html.twig.") in "CompetitiongameBundle:game:index.html.twig".

My index.html.twig looks like :

{% javascripts 'CompetitiongameBundle/Resources/views/public/js/*'%}
    <script type="text/javascript" src="{{ asset_url }}" ></script>
{% endjavascripts %}
Hello {{ name }}!

<a href='{{ nexturl }}' >Login</a>

My Bundle is already present in the config file when I do :

php app/console config:dump-reference assetic

How can I fix this ?

Nov 10, 2020 in PHP by kartik
• 37,520 points
413 views

1 answer to this question.

0 votes

Hello @kartik,

Try the below steps:

  1. edit app/config/config.yml
  2. then go to assetic:
  3. under assetic: go to bundles: []
  4. and in bundles: [] //type your bundle name

for instance if your bundle is Acme\DemoBundle, then do the following

assetic:
   bundles: [ AcmeDemoBundle ]

No quotes around AcmeDemoBundle

answered Nov 10, 2020 by Niroj
• 82,840 points

Related Questions In PHP

0 votes
1 answer

error: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in...

Hello @kartik, Use this SQL command: ALTER USER 'mysqlUsername'@'localhost' ...READ MORE

answered Oct 27, 2020 in PHP by Niroj
• 82,840 points
24,813 views
0 votes
1 answer

Error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 9

Hello @kartik, Replace TYPE=MyISAM with ENGINE=MyISAM The problem was "TYPE=MyISAM" which should ...READ MORE

answered Nov 16, 2020 in PHP by Niroj
• 82,840 points
11,315 views
0 votes
0 answers

PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client

I'm running MySQL version 8 on PHP ...READ MORE

Jun 18, 2022 in PHP by narikkadan
• 63,600 points
1,159 views
0 votes
0 answers
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
23,004 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
2,984 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,911 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,585 views
0 votes
1 answer

ERROR: The file 'wp-config.php' already exists

Hello, Try to display the website first on ...READ MORE

answered May 8, 2020 in PHP by Niroj
• 82,840 points
5,238 views
0 votes
1 answer

How to get the request parameters in symfony2

Hello @kartik, The naming is not all that ...READ MORE

answered Aug 14, 2020 in PHP by Niroj
• 82,840 points
3,153 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP