Skip to content

Failed to start parse server #1455

Open

Description

@wengzilla

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?

Activity

  1. guillaumewrobel commented on Oct 24, 2024

    @guillaumewrobel

    Same with @prettier/plugin-ruby 4.0.4 + prettier 3.3.3

  2. ilya-gritsenko commented on Nov 26, 2024

    @ilya-gritsenko

    Same error for me in WSL with @prettier/plugin-ruby 4.0.4 + prettier 3.4.0.

  3. ilya-gritsenko commented on Nov 26, 2024

    @ilya-gritsenko

    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

  4. ilya-gritsenko commented on Nov 27, 2024

    @ilya-gritsenko

    Downgrading to 4.0.2 also helps

  5. thrnjica commented on Mar 6, 2025

    @thrnjica

    The issue is resolved after deleting the following line of code:

    options.cwd = path.dirname(prettierConfig);

    Introducing an option to disable changing the child process's current working directory could provide a straightforward workaround.

  6. DennisTheMenace780 commented on Mar 21, 2025

    @DennisTheMenace780

    I was hitting this, but updating the editor (VSCode/Cursor) seems to have resolved it for me.

  7. JounQin commented on Apr 21, 2025

    @JounQin
    Member

    I got:

    <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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions