Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git SHA Config Causes Issues w/ "atom-ternjs" #229

Open
billdybas opened this issue Oct 6, 2018 · 1 comment
Open

Git SHA Config Causes Issues w/ "atom-ternjs" #229

billdybas opened this issue Oct 6, 2018 · 1 comment
Labels

Comments

@billdybas
Copy link
Member

After we introduced #227, every time I open a .js file in Atom, I get an error message that appears infinitely. Traced down the issue to the "atom-ternjs" package as disabling it causes the error messages to stop appearing.

We should figure out what's going on and fix it. I'm interested to know if other linters/auto-complete packages in other editors have similar issues. A possible solution is to use an existing webpack npm package that does this for us instead of rolling it on our own.

Atom version: 1.27.0-beta1
atom-ternjs version: 0.18.3

I get the error:

UncaughtException: Error: Command failed: git rev-parse --short HEAD
fatal: Not a git repository (or any of the parent directories): .git . Restarting Server...

Also, noticed there's a bunch of new linting errors introduced because of this change.
See https://eslint.org/docs/user-guide/integrations for a list of plugins for your preferred editor.

@billdybas billdybas added the Bug label Oct 6, 2018
@kristenmills
Copy link
Collaborator

As far as I know this is specifically an atom-ternjs thing. I ran into this at work about a year ago. There's not a good way to fix it because when the webpack is executed for tern, it is run outside of your current directory. I've two suggestions that i used, ultimately i went with the latter.

  1. const __gitSHA__ = execSync('git rev-parse --short HEAD').toString();
    Wrap this in an if(false){} and don't commit it. It will stop tern from trying to execute the code path locally and the errors will stop.

  2. Use typescript for your javascript autocomplete. I can't recall how well this works with atom...i stopped using atom awhile back, but in vscode and vim I've had a far better experience with typescript than tern-js even for javascript.

Hopefully that helps at least a little.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants