Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7903743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:49:41+00:00 2026-06-03T09:49:41+00:00

I want to try Meteor so I stated developing a small multi-rooms chat app

  • 0

I want to try Meteor so I stated developing a small multi-rooms chat app in coffeescript.
I am having problem passing the result of a findOne to html page using handlebars.

if Meteor.is_client
  room=Rooms.findOne({id:1})
  Template.room({room_name:room.name})

in the html page

 <head>
  <title>Chat!</title>
 </head>
 <body>
   {{> room}}
 </body>

<template name="room">
 Welcome to {{room_name}}
</template>

Now, given that the room document with id = 1 has name = ‘Room1’, I’d expect the page to render ‘Welcome to Room1’ but got a whitepage and the console shows 2 errors:

Uncaught TypeError: Cannot read property 'name' of undefined
Uncaught TypeError: Cannot read property 'room_name' of undefined

apparently room is undefined even if that document actually exists.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:49:43+00:00Added an answer on June 3, 2026 at 9:49 am

    It’s undefined for a split second, before the client database cache has time to sync to the server. The template is supposed to render again once the client syncs, but since it threw an error the first time that won’t happen (I was confused by a similar problem recently).

    Try this (using short-circuit && to test that room exists):

    if Meteor.is_client
        Template.room.room_name = ->
            room = Rooms.findOne({id:1})
            room && room.name
    

    Note: I moved the findOne call into the function to make sure it gets called when updates happen, but it may have also been fine where you had it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to try to create an iPhone app using PHP and I do
I want to try WTL, but problem is i can't use Visual Studio for
We want to try fast track developing a booking/scheduling system for a doctor's room.
i have the problem when i want to try web socket technology on my
I want to try the Google Eclipse plug-in for the Google App Engine, but
I want to try out a small, custom ValueConverter in a class which after
I want to try building a messaging app in Rails and I encountered a
I want to try developing a game for Google+. Does anyone know how these
I want to try testing the current ip address to find current country so
I want to try something that I imagine is somewhat simple. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.