Closed swarnendubiswas closed 2 years ago
I've tested here to make sure remote formatting of markdown files works in principle, and it does. So we'll need to debug this at your end.
After it hangs and you abort with C-g
there should be a buffer called *prettier cseproj227*
(assuming cseproj227
is the host you're connecting to.) Can you send the contents over or let me know in case it's empty?
Does it hang with all remote files (that you use Prettier with), all remote Markdown files, or just a specific Markdown file? If it's just a specific file, could you share it with me?
If you log into the remote host and run prettier
from the command line on the file in question, is there any interesting output?
Which Emacs version are you using and which version of this package?
Here is the output after aborting with C-g
.
swarnendu@cseproj227:~$ tramp_exit_status 0
swarnendu@cseproj227:~$
I tried with .json
on the same machine, Emacs hangs with the same output in the prettier
buffer. Prettier from the CLI on the remote machine works fine, it returns instantly.
My Emacs version is 27.1, Ubuntu 20.04, and prettier package is the latest from melpa 20210313.1047
.
It may have something to do with my setup. Any pointers to resolve the issue would be useful.
For a start you could set tramp-verbose
to something high, maybe 6, and put the resulting trace in a Gist. It might tell us what's going on.
You could also double-check that the remote path configuration is correct, see here. It's possible that it's not picking up the right node
executable?
It does look like something with your setup but I'm flagging this as a bug because we should handle this case better. At the very least it shouldn't hang, instead it should surface the remote output.
Could you check if the remote process is still active when it hangs? (Is it still listed in M-x list-process
output?)
I had to use a different remote machine but the behavior is the same.
The logs contain mention of a timeout. There's a variable prettier-timeout-seconds
that defaults to 20s. It wouldn't take that long to connect and start Prettier remotely, would it?
No, I do not think so unless there is something wrong in my node
setup. The following log from the second remote machine seems reasonable.
swarnendu:~$ prettier --version
2.2.1
swarnendu:~$ node --version
v14.16.0
swarnendu:~$ which node
/usr/bin/node
swarnendu:~$ echo $PATH
/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/swarnendu/.local/bin:/home/swarnendu/anaconda3/condabin:/home/swarnendu/tmp/node_modules/.bin:/home/swarnendu/tmp/textlint-workspace/node_modules/.bin:/opt/bin:/home/swarnendu/prospar-workspace/data-race-framework:/home/swarnendu/prospar-workspace/spmv-framework:::/home/swarnendu/.luarocks/bin:/home/swarnendu/.cargo/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
swarnendu:~$
I use the Prettier VSCode extension for editing the same files on the same remote machines, and they work fine.
Hi @swarnendubiswas , I made a Docker environment to test running Prettier via TRAMP: https://github.com/jscheid/prettier.el/tree/master/docker-envs/issue-84
You could try changing this test case to match your environment. Hopefully this lets you recreate the issue.
Without being able to recreate it, there's not much I can do at this point so I'm going to close this. Feel free to reopen if you succeed.
Describe the bug Emacs hangs when trying to open and edit a remote markdown file.
Link to
M-x prettier-info
outputM-x prettier-info
hangs.To Reproduce
Here is my MWE.
Expected behavior
I expect the editing flow to be normal and prettier to return.
Additional context
Remote machine
Local machine