title: FOSJSRoutingBundle : "Route xxx does not exist"
body: <p>I'm facing a really weird problem with FOSJSRoutingBundle : </p>
  
  <p>First of all, here is my configuration : I'm working on Symfony 2.0.23 and with JQuery, on Windows 7 64 bits with a WAMP (Apache 2.4.2 and PHP 5.4.3). 
  I've done all the settings from the FOSJSRoutingBundle's github and haved exposed my routes ( almost all the related problems I could find by googling (on FOSJSRoutingBundle's github,here and on different forums) were because people have not exposed their routes, but I tried php app/console fos:js-routing:debug and I do see my routes).
  The js is added to the layout (code of the layout at the end).</p>
  
  <p>Trying to generate url for routes in js, at the beginning I wanted to generate two different routes but for test I created the js code below : </p>
  
  <pre><code>    //Code inside this function is working
      $("select").change(function () {
        param=this.options[this.selectedIndex].value;
        test1=Routing.generate('myBundle_step3', { myParam: param });
        alert(test1);
        window.location=Routing.generate('myBundle_step2');
      });
      //Code inside this one is also working
      $('input[type="checkbox"]').change(function() {
        test=Routing.generate('myBundle_step2');
      }).change();
      //This is not working
      test=Routing.generate('myBundle_step2');
      alert(test);
  </code></pre>
  
  <p>With this code, I get the javaScript error "The route myBundle_step2 does not exist". Though the first part still works (alert gives me the link created and the redirection goes well). 
  If I remove the second function, I do not get the Javascript error anymore. </p>
  
  <p>If in the second function I replace step2 by step3, the error becomes "The route myBundle_step3 does not exist".
  I tried to clear the cache and to run php app/console asset:install --symlink again, but no results.</p>
  
  <p>Here is the controller corresponding code (the real code is a bit long and I don't think it's relevant, if you think so, I could put it anyways :</p>
  
  <pre><code>    namespace my\Bundle\Controller;
      class IndividuController extends Controller
      {
        public function step2Action() {
          Some code
        }
        public function step3Action($myParam) {
          Some code
        }
      }
  </code></pre>
  
  <p>The routing.yml config file relative to the bundle : </p>
  
  <pre><code>    myBundle_step2:
        pattern: /step/2
        defaults: {_controller: myBundle:Individu:step2}
        options:
          expose: true
      myBundle_step3:
        pattern: /step/3/{myParam}
        defaults: {_controller: myBundle:Individu:step3}
        options:
          expose: true
  </code></pre>
  
  <p>The app/config/routing.yml file : </p>
  
  <pre><code>    fos_js_routing:
        resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
  
      myBundle:
        resource: "@myBundle/Resources/config/routing.yml"
        prefix:   /
  </code></pre>
  
  <p>The layout's relevant informations : </p>
  
  <pre><code>     &lt;!-- jQuery via Google + local fallback, see h5bp.com --&gt;
          &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;    &lt;/script&gt;
          &lt;script&gt;window.jQuery || document.write('&lt;script src="js/jquery-1.7.1.min.js"&gt;&lt;\/script&gt;')&lt;/script&gt;
             {% javascripts 'bootstrap/js/bootstrap.js'
                          'bundles/fosjsrouting/js/router.js'
                          'bundles/crrisuaps/js/suaps.js' %}
                 &lt;script type="text/javascript" src="{{ asset_url }}"&gt;&lt;/script&gt;
             {% endjavascripts %}
          &lt;script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"&gt;&lt;/script&gt;
         &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Result of php app/console router:debug (I left only the relevant informations + I left the undefined variable notice just in case, it's a notice I got since I added this library, still the library works and I do not think the problem could come from here : </p>
  
  <blockquote>
    <p>C:\wamp\www\suapsRepo\suaps>php app/console router:debug</p>
    
    <p>Notice: Undefined variable: kPathUrl in C:\wamp\www\suapsRepo\suaps\vendor\html2
        pdf_class\tcpdfConfig.php on line 80</p>
    
    <p>Call Stack:
           0.0070     231536   1. {main}() C:\wamp\www\suapsRepo\suaps\app\console:0
           0.0209     685656   2. require_once('C:\wamp\www\suapsRepo\suaps\app\bootstr
        ap.php.cache') C:\wamp\www\suapsRepo\suaps\app\console:10
           0.0212     701752   3. require_once('C:\wamp\www\suapsRepo\suaps\app\autoloa
        d.php') C:\wamp\www\suapsRepo\suaps\app\bootstrap.php.cache:3
           0.1335    2998152   4. require_once('C:\wamp\www\suapsRepo\suaps\vendor\html
        2pdf\html2pdf.class.php') C:\wamp\www\suapsRepo\suaps\app\autoload.php:51
           0.1379    3361792   5. require_once('C:\wamp\www\suapsRepo\suaps\vendor\html
        2pdf_class\myPdf.class.php') C:\wamp\www\suapsRepo\suaps\vendor\html2pdf\html2p
        df.class.php:19
           0.1385    3393792   6. require_once('C:\wamp\www\suapsRepo\suaps\vendor\html
        2pdf_class\tcpdfConfig.php') C:\wamp\www\suapsRepo\suaps\vendor\html2pdf_class
        \myPdf.class.php:12</p>
  </blockquote>
  
  <p>[router] Current routes</p>
  
  <pre><code>    Name                                            Method Pattern
      _assetic_55f0319                                ANY    /css/55f0319.css
      _assetic_55f0319_0                              ANY    /css/55f0319_bootstrap_1.
      css
      _assetic_55f0319_1                              ANY    /css/55f0319_bootstrap-re
      sponsive_2.css
      _assetic_55f0319_2                              ANY    /css/55f0319_style_3.css
      _assetic_3608a04                                ANY    /js/3608a04.js
      _assetic_3608a04_0                              ANY    /js/3608a04_bootstrap_1.j
      s
      _assetic_3608a04_1                              ANY    /js/3608a04_router_2.js
      _assetic_3608a04_2                              ANY    /js/3608a04_suaps_3.js
  
      fos_js_routing_js                               ANY    /js/routing.{_format}
      myBundle_homepage                        ANY    /
  
      myBundle_inscription_etape1              ANY    /inscription/etape/1
      myBundle_inscription_etape2              ANY    /inscription/etape/2
      myBundle_inscription_etape3              ANY    /inscription/etape/3/{dis
      ciplineSelection}
  </code></pre>
  
  <p>Result of php app/console fos:js-routing:debug (I removed the PHP Notice but it happens on every command I make btw) :</p>
  
  <pre><code>    C:\wamp\www\suapsRepo\suaps&gt;php app/console fos:js-routing:debug
      [router] Current routes
      Name                               Method Pattern
      crrisuapsBundle_inscription_etape2 ANY    /inscription/etape/2
      crrisuapsBundle_inscription_etape3 ANY    /inscription/etape/3/{disciplineSelect
      ion}
  </code></pre>
  
  <p>Edit : Also, don't know if it's relevant but when I try 'php app/console fos:js-routing:debug myBundle_step2' I get the following php error : </p>
  
  <blockquote>
    <p>[Error Exception]
    Warning: Missing argument 3 for Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand:outputRoute(), called in C:\symfonyDirectory\vendor\bundles\FOS\JsRoutingBundle\Command\RouterDebugExposedCommand.php on line 62 and defined in C:\serverDirectory\vendor\symfony\src\Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand.php line 98</p>
  </blockquote>