Right now my head is spinning from the awesomeness that is Meteor. I am somewhere in between “This is too much magic to really believe…” and “Wow - why have I ever built anything with anything else before!”.
Just a short little post about an error that have caused me problems. Here’s the error, that most likely pops up in your browser console:
Uncaught SyntaxError: Unexpected token Y
TL;DR - Reload your browser
Longer … but still short and sweet
Meteor is super helpful in many ways. Creating an app is just three small steps:
meteor create myPrecious cd myPrecious meteor
That last one is very special. That starts the application and live reloads the page for every change you make. So you litterally write that
meteor command once and then open a new tab / window where you install packages, add files etc. It’s always running.
The moment you make any changes in your application any browser pointing to it is reloaded too. Yes, Meteor has built in LiveReload.
But this helpfulness is what trips me up. Because now Meteor is running away in the background and I never look there again. When I mess up a
</code> tag, for example, I will not see the helpful message it spits out:
=> Errors prevented startup: While building the application: client/components/poll-form.html:26: bad formatting in HTML template
Uncaught SyntaxError: Unexpected token Y.
Fix it with reload. Yes, manually!
Now, this is the first time you actually need to reload the browser manually. Which quite frankly, feels really cumbersome (!) after being spoiled by Meteor all this time. Imagine that.
Once you reload the browser all is clear and helpful again. This is the text that Meteor sends to the client.
Your app is crashing. Here's the latest log. => Meteor server restarted Errors prevented startup: While building the application: client/components/poll-form.html:25: bad formatting in HTML template Your application has errors. Waiting for file change.
Unexpected token Y is the start of
Should you see the
Uncaught SyntaxError: Unexpected token Y remember the old days and just reload the browser window. It’s a hassle I know :)