Sublime text 3 + TernJS + Meteor Autocomplete error.. HELP

Tried to install TernJS + Meteor Autocomplete on Sublime to get the autocomplete features. However I keep getting the error message like this:

Failed to start server:

/Users/LinX/Documents/Web/meteor/meteor.js:2
Tasks = new Mongo.Collection(“tasks”);
^
ReferenceError: Mongo is not defined
at Object. (/Users/LinX/Documents/Web/meteor/meteor.js:2:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at loadPlugins (/Users/LinX/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:148:15)
at startServer (/Users/LinX/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:242:17)
at Object. (/Users/LinX/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:231:20)

Solved…

I have the same issue, how did you fixed it?

I didn’t specify a javascript build system. Once I have done that, the error disappeared.

Create a new build system in Sublime text with following code

{
“cmd”: [“node”, “–use-strict”, “–harmony”, “$file”],
“selector”: “source.js”,
“path”: “/usr/local/bin/”
}

Hope that works for you as well.

1 Like

Any idea if this will work on Sublime Text 2?

where this code should be?

Inside Sublime text 3, go to Tools -> Build systems -> New build systems

1 Like