ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

TernDef returns "TypeError: cannot read property 'origin' of null" #111

Closed jaapz closed 8 years ago

jaapz commented 8 years ago

So I have the following configuration:

{
    "libs": [
        "browser",
        "ecma6",
        "jquery"
    ],
    "plugins": {
        "node": {},
        "es_modules": {}
    }
}

And I use tern_for_vim to supply autocompletion to javascript files in vim.

Now, when I import a function like this:

import sprintf from 'underscore.string/sprintf';

And then do :TernDef on the sprintf, I'm not taken to the definition of sprintf and instead I get the error message as described in the title of this message.

However, when I import it like this:

import * as us from 'underscore.string';

I have working autocompletion on the us object, and :TernDef correctly brings me to the main.js file of underscore.string.

I get this message also on modules that don't live in node_modules, but not always :(

jaapz commented 8 years ago

Sorry I just realized this is the wrong repository, I will move it to the correct repo.