Skip to content

Query param changes during navigation breaks FlowRouter #66

@arggh

Description

@arggh

A call to FlowRouter.setQueryParams({ foo: 'bar' }), at approximately the same time as a navigation happens, breaks the FlowRouter completely - rendering the app useless.

See reproduction with instructions included in the repro app itself:

https://github.com/arggh/flow-router-waiton-issue

Just clone the repro, run npm install and meteor.

May-22-2019 12-29-31

Situation where this occurred and explanation what happens:

  1. There is a link inside a div, that takes us to another page.
  2. We also have a click event listener on the link's parent div, which has a handler that will call FlowRouter.setQueryParams`.
  3. User clicks on the link
  4. Click listener will cause a query parameter change to be triggered
  5. waitOn will get called on the current route
  6. Navigation takes place and FlowRouter picks up route change
  7. waitOn will get called on the new route
  8. endWaiting will get called twice on the new route
  9. action will also get called twice on the new route, once before the dynamic import promise has been resolved in waitOn, thus breaking the app.
  10. Any further attempts at navigating will not work
  • Version of flow-router-extra you're experiencing this issue 3.6.3
  • Version of Meteor you're experiencing this issue 1.8.1
  • Browser name and its version All of them
  • If you're getting an error or exception, please provide its full stack-trace as plain-text or screenshot
meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:1059 Exception from Tracker recompute function:
meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:1059 Error: Can't render undefined
    at checkRenderContent (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:2285)
    at contentAsFunc (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:2328)
    at Object.Blaze.renderWithData (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:2401)
    at BlazeRenderer.materialize (renderer.js:341)
    at BlazeRenderer._load (renderer.js:258)
    at BlazeRenderer.proceed (renderer.js:198)
    at BlazeRenderer.startQueue (renderer.js:98)
    at BlazeRenderer.render (renderer.js:90)
    at Route.action [as _action] (main.js:34)
    at Route.callAction (route.js:304)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions