Meteorjs Global Variables are undefined in chrome


#1

I have a Meteor application which of course have some Global variables such as collections or some functions that I want to use in both server and client side. The problem is after the new version of Chrome all of the Global variables are undefined on client side, however it works fine on other browsers such as IE, Firefox etc. Moreover, what is strange is it works fine on chrome when I run the application locally but the problem arises just when I deploy the application on the server.

Could someone help regarding this issue?


#2

I have been having lots of issues with the latest chrome. This could be completely anecdotal, but it seems like having the console/inspector open when the page loads/refreshes gives me access. Otherwise, I sometimes can’t access anything (even jQuery!)


#3

This is possibly related to the v51 series of Chrome having a problem with parsing some sourcemaps. It seems to be their issue, not Meteor’s though perhaps Meteor may be doing something a bit unusual to trigger it. You may see the following in the Chrome console…

Failed to parse SourceMap: http://localhost:3000/packages/f06479c1029d2c36772d6aec75c0c039f896e199.map

I downloaded a beta version of 52 (I’ve got version “52.0.2743.49 beta (64-bit)”). The problem seems to be fixed there.


#4

Thanx for the response. For me the only problem is with Meteor Global Variables, the rest works fine and it was working fine in the previously on chrome as well. And refreshing does not help, Global Variables are always undefined on chrome.


#5

Beta version of chrome didn’t work for me.


#6

What happens if you go to https://meteor.com with your version of Chrome and run the following in your browser console?

console.log(Jobs)

This will help rule out your application.


#7

p.Collection {_transform: null, _connection: u, _collection: f, _name: “jobs”, _driver: _…}

this is the result of the console.


#8

So it looks like globals are working with your version of Chrome in other applications. This points to an issue with your application or environment. Where are the variables showing as undefined - can you show us some sample code?