Dazed And Confused

Hi, Im currently doing the rounds of learning Javascript and all things related such as Angular, Coffeescript etc… and now i’ve come to try Meteor and it’s not going well at all?

As a complete novice to Meteor I followed the install instructions and got everything setup and running including a new project at localhost:3000.

So great I think, I’ll follow some Youtube videos… quite quickly it becomes apparent, that Meteor has changed since the video was made, so I give up on that (as I don’t have project.html, *.css *.js instead I have main.html , main.css etc… No big deal I’ll follow the tutorial on the Meteor website…

Only… right at the very beginning after project creation, im told to change the code in “imports” folder? which I simply do not have ? even the tutorial which shows the default files installed shows there is no imports folder?

So i give up on this…

I search for updated tutorials, and come across a Free ebook , im sure you know the one, anyway I read this one evening without trying the code on my computer and all seams really good and explained really well, that is until I actually come to try the code in the book , and when i try to insert data into the mongoDB database, I get an error

`    PlayersList.insert({
     name: "David",
     score: 0
     });
     "YuhrSydsXwX7kihd7"
     insert failed: Method '/players/insert' not found`

so it looks like it part works but then fails, maybe on the server only? or maybe on the client?

So again I find myself having to give up?

So my question is can somebody point me to something I can use to learn the latest version of Meteor, or maybe I should be learning an older version??

To be honest im totally lost, ive never come across anything so promising, yet so flawed in all my days.
take Angular for instance, simply pull in the script and your away, simple! why is Meteor so difficult to learn?
Surely the point is to make Meteor New user friendly to help grow its following?

I cant be the only new user left scratching their heads?

Please help, as i would really like to try Meteor out properly…

Thanks Paul

1 Like

Also I was told that if you did a console.log you would see output in both the console and in the terminal, but I don’t get anything in the terminal apart from a refresh notice from when the file was saved. Even after trying a if(Meteor.isServer) the output is not rendered in the terminal.

Use the official tutorial and create any missing folders yourself.

About the console.log, it does matter where this code is being defined of course. When it’s build to run only on the client, it will be impossible to run on both, the client and the server.

Code is shared between client and server, but in the same time also being separated.

// imports/lib/log.js
export default function(message) {
  console.log(message);
}
// lib/log.js
Meteor.startup(() => {
  console.log('I run everywhere, everytime, on startup');
});
// imports/client/main.js
import log from '../imports/lib/log';
log('foo');
// server/main.js
import log from '../imports/lib/log';
log('foo');

And indeed, a lot has changed this last month. Because of a new release of Meteor (1.3). One of the great things that has changed, is this official guide. Please check it out. Also the docs are updated as you could expect.

If that’s not enough, please get started by using the official tutorial

And if you feel to get serious right from the beginning (I do warn you, because it will take a lot of reading and studying); I would suggest you dive into the (not official Meteor) Mantrajs.

Most of this would have been clear if you go to Meteor’s home. (Most) unofficial tutorials / howto’s / ebooks are indeed outdated. But the official docs are getting better and better every day. As far as I know, they are up to date, and of great help.


me across a Free ebook , im sure you know the one

No, sorry, I have no idea which one. There are a lot of ebooks available out there.

1 Like

Thanks for the help, I`ll try and give the tutorial another look and create the missing folders manually and see if that works out:

I was using console.log in the clients/main.js and output was just seen in the console.

Thanks Paul

That’s because code in /clients runs only on the client, just as code in a /server directory runs only on the server. Please see the chapter special-directories in the official guide.

1 Like

Thank you , that makes sense :slight_smile:

although the ebook didn’t mention that and simply said you had to use Is.Server and is.Client to send data specifically to each one… Never mind I guess thats out of date.

Thanks Paul

Im happy to report that by creating the folders manually and following the official Tutorial I managed to get the todolist up and running , and quite enjoyed the tutorial :smiley:

Thanks for the pointers

Paul

4 Likes