rclai/meteor-ddp-inspector

Conflict with flow router

pihentagy opened this issue · 2 comments

I am getting this message

Error: You can't use reactive data sources like Session inside the `.subscriptions` method!
    at router.js:417
    at Tracker.Computation._compute (tracker.js:323)
    at Tracker.Computation._recompute (tracker.js:342)
    at Object.Tracker._runFlush (tracker.js:481)
    at onGlobalMessage (setimmediate.js:102)

My router:

FlowRouter.route '/',
    name:'home',
    action: (params) ->
        console.log "yeah baby"
        BlazeLayout.render 'layout', main: 'home'

FlowRouter.route '/session/:sessionId',
    name: 'session'
    subscriptions: (params) ->
        console.table params
        @register 'oneSession', Meteor.subscribe('meeting', params.sessionId)
        @register 'matches', Meteor.subscribe('mathcup')
    action: (params) ->
        BlazeLayout.render 'layout', main: 'session'

The subscriptions:

    Meteor.publish 'meeting', (meetingId) ->
        log "Waiting for meeting #{meetingId}"
        Meteor._sleepForMs 1000
        Meeting.find _id:meetingId
    Meteor.publish 'matchup', -> Matchup.find {}
rclai commented

This is weird. What happens if you take out the subscriptions function off your session/:sessionId route?

The session view not works (no data will be fetched). No error on chrome console however.