[Solved] Global variables with meteor 1.4.1.1


#1

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

definition.js

my_global = true

usage.js

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 1.4.1.1 / 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 1.4.1.1, the idea being to first update the components (Mongo, Meteor) and then migrate the code.


#2

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


#3

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 1.4.1.1 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 1.4.1.1