Closed ficristo closed 9 years ago
I just reproduced the issue, so that made it easier to figure what the issue is. You would need to explicitly tell tern what other stuff the node
plugin depends on. I got it working with a very bare minimum config of
{
"plugins": {
"modules": {},
"commonjs": {},
"node": {}
}
}
However, I would add the extra plugin node_resolve
. This is what my config looks like:
{
"libs": [
"./libs/tern/defs/reserved",
"./libs/tern/defs/lodash",
"browser",
"chai",
"ecma5",
"ecma6",
"browser",
"jquery"
],
"loadEagerly": [],
"async": true,
"plugins": {
"modules": {},
"node_resolve": {},
"commonjs": {},
"node": {}
}
}
Here is some information on the node plugin for tern. http://ternjs.net/doc/manual.html#plugin_node
I had read the information and thought that adding node
plugin implied that modules
, node_resolve
and commonjs
were also added.
I explicitly added the plugins and now don't see the error anymore.
Thank you for the answer.
I tried to enable the node plugin but I get this error:
Uncaught TypeError: Cannot read property 'knownModules' of undefined
Do you know what could be?It sufficient to have a
.tern-project
file at the root of the project like this: