Skip to content

The route does not exist + 500 routing?callback=fos.Router.setData #275

@Hellow

Description

@Hellow

Hi,

I have thi issue since yesterday and I tried to find a solution but nothing is working.

So I've done the installation as it has been said in the doc.

  • Downloaded the bundle and declared it in AppKernel.php and routing.yml
  • Registred my route on routing.yml with expose at True
showImage:
    path: /showImage/{varI}/{varS}
    defaults:
        _controller: MyBundle:Default:showImage
        varI: null
        varS: null
    options:
        expose: true
  • Published the assets
  • Added the two scripts on my html.twig page
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}"></script>

Debug of the route on the terminal :

[...]\websitename>php app/console fos:js-routing:debug
[router] Current routes
 Name            Method Scheme Host Path
 showImage ANY    ANY    ANY  /showImage/{varI}/{varS}

But I keep having this error on my console when I use the code Routing.generate('showImage', { varI: idI, varS: 0}) in my js file (my idI has a value) :

Error: The route "showImage" does not exist.                           router.js:9:313
	i.i http://localhost/websitename/web/bundles/fosjsrouting/js/router.js:9:313
	i.m http://localhost/websitename/web/bundles/fosjsrouting/js/router.js:10:27

And I also get a 500 internal error
http://localhost/websitename/web/app_dev.php/js/routing?callback=fos.Router.setData
And on this page:
An exception has been thrown during the rendering of a template ("The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.").

I work with symfony 2.7
I've cleared the cache
I've tried with different stable releases of the FosJSBundle but I keep getting the same error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions