[Solved] Global variables with meteor

I updated a project from 1.3.x.x to and all this broke all the global variables defined in separate files


my_global = true


if (my_global) { console.out ("true") } 

Is there a minimal way to fix this ?

I have a new version of the code, completely rewritten run on / es6 including imports and exports. It’s in customer testing right now. Which is why I am looking for the minimal fix that allows me to run the old code on, the idea being to first update the components (Mongo, Meteor) and then migrate the code.

In general this should work. Where are the files located? What is your directory structure?

1 Like

I finally debugged this : it’s a syntax error due to an async that wants an extra semi-colon because it doesn’t like the function being defined and immediately executed. The syntax error made a global variable look like it was the problem but it wasn’t. I don’t really understand how this broke between the update from 1.3.x.x to actually. It might be more related to Meteor merging or not all the files into one.

In any case, the global variables work as expected in