Just getting started with Meteor, on Windows. Following the initial instructions, the automatically generated "Hello World" app is running on localhost. The text and button are there, but clicking it doesn't output anything to the console. However, replacing console.log() with alert() does show the text ("You pressed the button") in the pop-up window.
the console.log() output is printed in the browser. but it gets cleared immediately if you are submitting a form or handling an event as the page automatically gets refreshed.
if you want it to work, 1.Use chrome browser 2. check "Preserve log" check box on the console. then you can see the log
@dimfisch - I didn't see a console.log
in your code snippet above. At any rate, I'm reiterating my comment as an answer:
Any console.log
entries that are inside a Meteor.isServer
block will by default NOT show up in the browser's console log. They'll show in the terminal from where you launched your app via the meteor
command.
console.log
with alert
in the code. And since it's in a Meteor.isClient
block I'm not seeing it in the terminal window. Thanks. –
Slovakia For anyone coming by here and currently losing your mind: for me I had searched using the Filter textbox at the top of the console. If you forget to clear that, you wont see any of your logs that don't match the filter :)
Make sure you are looking at the right console. It might be your console is not logging the page you are testing. :) Happened to me.
On the console, the left of any console.log() you write to the console, there are a sidebar with several tabs: eg. 5 messages, 2 user messages, 4 errors, 1 warning, No info, No verbose etc.
I find myself this morning not selecting the '5 user messages' item on the left panel. Instead, I have selected the 'No errors' item accidently. So I don't see any console.log() there. That can be one of the reasons.
In the console sidebar, open the "X Info" tab where "X" is the number of messages or something.
© 2022 - 2024 — McMap. All rights reserved.
console.log
inside aMeteor.isServer
block? If so, it will render in the terminal from which you ranmeteor
to start your project, not the browser console. – Grazynagreabeif (Meteor.isClient) { Template.hello.greeting = function () { return "Welcome to patio."; } Template.hello.events({ 'click input' : function () { // template data, if any, is available in 'this' if (typeof console !== 'undefined') alert("You pressed the button"); } }); }
@Grazynagreabe I guess that's it. It's in aMeteor.isClient
block. – Slovakia