atom-elixir-formatter icon indicating copy to clipboard operation
atom-elixir-formatter copied to clipboard

Getting Elixir Fomatter Error

Open arnimikelsons opened this issue 4 years ago • 15 comments

When I am saving a file (for Phoenix / Elixir), I get an Error:

Elixir Formatter Error

Error: spawnSync mix ENOENT

And it is not formatting the code.

arnimikelsons avatar Sep 20 '20 05:09 arnimikelsons

I recently upgraded to Mac os version 10.15.7. Is there anything else about my environment I can tell you to try to track this down

arnimikelsons avatar Oct 13 '20 20:10 arnimikelsons

Sorry for the slow reply. Could you post the full stack trace? I've never seen this issue before and it will help isolate the problem. Thanks

rgreenjr avatar Oct 13 '20 23:10 rgreenjr

Can you point me to how I can do that?

arnimikelsons avatar Oct 13 '20 23:10 arnimikelsons

Errors get logged to the Atom console, which you can view it by clicking on View > Developer > Toggle Developer Tools.

rgreenjr avatar Oct 14 '20 21:10 rgreenjr

Is this helpful? This is a deprecation.

stacktrace/styles/stacktrace.lessfile:///Users/arnimikelsons/.atom/packages/stacktrace/styles/stacktrace.less · Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors: o .stacktrace .frame atom-text-editor::shadow .scroll-view => .stacktrace .frame atom-text-editor.editor .scroll-view Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

When I save, nothing shows up in the console.

Arni

From: Ron Green [email protected] Reply-To: rgreenjr/atom-elixir-formatter [email protected] Date: Wednesday, October 14, 2020 at 5:17 PM To: rgreenjr/atom-elixir-formatter [email protected] Cc: Arni Mikelsons [email protected], Author [email protected] Subject: Re: [rgreenjr/atom-elixir-formatter] Getting Elixir Fomatter Error (#29)

Errors get logged to the Atom console, which you can view it by clicking on View > Developer > Toggle Developer Tools.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/rgreenjr/atom-elixir-formatter/issues/29#issuecomment-708665171, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AADWVJ5TPOFA2C3CNBGDBMLSKYIO3ANCNFSM4RTOEOGQ.

arnimikelsons avatar Oct 15 '20 04:10 arnimikelsons

Hi @arnimikelsons – It appears the formatter is having trouble running the Elixir mix build tool. Please try reinstalling Elixir and verifying that you can successfully run the mix command manually from a terminal. That will hopefully resolve the issue.

rgreenjr avatar Oct 18 '20 13:10 rgreenjr

I am able to run mix successfully in a terminal (all the time, actually). Would it be that the path is wrong?

which mix

returns /usr/local/bin/mix

Is there a place that can be set?

arnimikelsons avatar Oct 18 '20 18:10 arnimikelsons

Yes, take a look a the project documentation – it shows how you can specify the absolute path of your elixir executable. Hopefully, this will resolve the issue.

rgreenjr avatar Oct 19 '20 15:10 rgreenjr

Long time in responding. Unfortunately not.

which mix

returns /usr/local/bin/elixir

I put that in the Settings, and then I get an error:

   /usr/local/bin/elixir: line 230: exec: erl: not found

arnimikelsons avatar Dec 06 '20 20:12 arnimikelsons

Thanks, that's helpful. The error means it's not finding the path to your erlang installation. You'll need to make sure erlang is in your path.

rgreenjr avatar Dec 07 '20 15:12 rgreenjr

arnimikelsons% which erl /usr/local/bin/erl

is that not correct?

arnimikelsons avatar Dec 07 '20 16:12 arnimikelsons

Yeah, that looks correct. This is unusual and I'm not sure what's going on, but the erl: not found error indicates that it's not being found on your path when run outside of your shell.

I'm not sure why it's not seeing your PATH environment values, but I'd recommend downloading and re-installing the latest version of Atom. It's probably the easiest next step to rule out that issue.

rgreenjr avatar Dec 07 '20 23:12 rgreenjr

downloaded and resinstalled Atom. Also upgraded Elixir, and it is the same.

arnimikelsons avatar Dec 22 '20 02:12 arnimikelsons

I ran into this using asdf to manage Elixir/Erlang on Ubuntu 20.10 and I was able to fix it by verifying a global version was set for both and then restarting atom.

tfwright avatar Mar 28 '21 20:03 tfwright

Also ran into this running Atom 1.58.0 on macOS 12.2. It may be a bug in Atom; the PATH in process.env["PATH"] doesn't have the default PATHs I've set in my shells unless it was started from a shell. The work-around is to always start atom from your shell.

photomattmills avatar Feb 02 '22 19:02 photomattmills