rclai / meteor-ddp-inspector

Allows you to see all DDP activity in the client-side.
https://atmospherejs.com/lai/ddp-inspector
23 stars 4 forks source link

Conflict with flow router #5

Open pihentagy opened 8 years ago

pihentagy commented 8 years ago

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 8 years ago

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

pihentagy commented 8 years ago

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