You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently using VSCode Prettier Plugin v10.4.0 + @prettier/plugin-ruby 4.0.2 + prettier 3.0.3.
I'm getting the following error:
Error: Failed to start parse server.
at Timeout.<anonymous> (file:///.../node_modules/@prettier/plugin-ruby/src/plugin.js:127:16)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
However, if I run ./node_modules/.bin/prettier --plugin=@prettier/plugin-ruby --write '**/*' it works no problem. What's going on?
Did a little debugging and noticed that it's failing after 'require "syntax_tree"'. So I just tried to execute "bundle add" instead of "gem install" like this: "bundle add prettier_print syntax_tree syntax_tree-haml syntax_tree-rbs" and now it's working. I'm thinking it's because I'm using rbenv but not sure.
<internal:/opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': cannot load such file -- syntax_tree (LoadError)
Did you mean? syntax_suggest
from <internal:/opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from /opt/homebrew/Library/Taps/homebrew-x/homebrew-x/node_modules/@prettier/plugin-ruby/src/server.rb:7:in '<main>'
[error] Casks/imfile.rb: Error: Failed to start parse server.
[error] at Timeout.<anonymous> (file:///opt/homebrew/Library/Taps/homebrew-x/homebrew-x/node_modules/@prettier/plugin-ruby/src/plugin.js:127:16)
[error] at listOnTimeout (node:internal/timers:594:17)
[error] at process.processTimers (node:internal/timers:529:7)
<internal:/opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': cannot load such file -- syntax_tree (LoadError)
Did you mean? syntax_suggest
from <internal:/opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from /opt/homebrew/Library/Taps/homebrew-x/homebrew-x/node_modules/@prettier/plugin-ruby/src/server.rb:7:in '<main>'
[error] Casks/sogouinput.rb: Error: Failed to start parse server.
[error] at Timeout.<anonymous> (file:///opt/homebrew/Library/Taps/homebrew-x/homebrew-x/node_modules/@prettier/plugin-ruby/src/plugin.js:127:16)
[error] at listOnTimeout (node:internal/timers:594:17)
[error] at process.processTimers (node:internal/timers:529:7)
OK, after gem install syntax_tree, it's working as expected now.
Activity
guillaumewrobel commentedon Oct 24, 2024
Same with @prettier/plugin-ruby 4.0.4 + prettier 3.3.3
ilya-gritsenko commentedon Nov 26, 2024
Same error for me in WSL with @prettier/plugin-ruby 4.0.4 + prettier 3.4.0.
ilya-gritsenko commentedon Nov 26, 2024
Did a little debugging and noticed that it's failing after 'require "syntax_tree"'. So I just tried to execute "bundle add" instead of "gem install" like this: "bundle add prettier_print syntax_tree syntax_tree-haml syntax_tree-rbs" and now it's working. I'm thinking it's because I'm using rbenv but not sure.
UPD: if I delete Gemfile it's starting to work
ilya-gritsenko commentedon Nov 27, 2024
Downgrading to 4.0.2 also helps
thrnjica commentedon Mar 6, 2025
The issue is resolved after deleting the following line of code:
plugin-ruby/src/plugin.js
Line 79 in ed8a257
Introducing an option to disable changing the child process's current working directory could provide a straightforward workaround.
DennisTheMenace780 commentedon Mar 21, 2025
I was hitting this, but updating the editor (VSCode/Cursor) seems to have resolved it for me.
JounQin commentedon Apr 21, 2025
I got:
OK, after
gem install syntax_tree, it's working as expected now.