Repository navigation
Timeout Issue? #1228
Copy link
Copy link
Closed
Description
Running in VS Code with Prettier plugin, plugin-ruby installed with NPM, every time I try to parse I am getting this error shown below. I've increased time to: PRETTIER_RUBY_TIMEOUT_MS=50000
I've tried multiple times, only one time about of 20 did the code actually re-format. And, this error comes up much quicker than 50 seconds.
Any troubleshooting tips?
Metadata
- Operating system: MacOS 12.3.1 M1
- Ruby version: 3.1.2
- Node version: v17.8.0
@prettier/plugin-rubyorprettiergem version: latestsyntax_treeversion: latest
Input
# frozen_string_literal: true
class Test88ComponentPreview < ViewComponent::Preview
def default
render(Test88Component.new(title: "title"))
end
endError
["INFO" - 2:50:53 PM] Formatting file:///Users/mst49/workspace/sps-ui/test/components/previews/test_88_component_preview.rb
["INFO" - 2:50:53 PM] Using config file at '/Users/mst49/workspace/sps-ui/.prettierrc.yml'
["INFO" - 2:50:53 PM] Using ignore file (if present) at /Users/mst49/workspace/sps-ui/.prettierignore
["INFO" - 2:50:53 PM] File Info:
{
"ignored": false,
"inferredParser": "ruby"
}
["INFO" - 2:50:53 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 2:50:53 PM] Prettier Options:
{
"filepath": "/Users/mst49/workspace/sps-ui/test/components/previews/test_88_component_preview.rb",
"parser": "ruby",
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true
}
["ERROR" - 2:50:58 PM] Error formatting document.
Error:
We failed to spawn our parser server. Please report this error on GitHub
at https://github.com/prettier/plugin-ruby. The error message was:
/Users/mst49/workspace/sps-ui/node_modules/@prettier/plugin-ruby/src/getInfo.js:12
throw new Error(`Failed to get information from parse server in time. If this
^
Error: Failed to get information from parse server in time. If this
happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment
variable beyond 5000.
at Timeout._onTimeout (/Users/mst49/workspace/sps-ui/node_modules/@prettier/plugin-ruby/src/getInfo.js:12:9)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Node.js v17.8.0
.
at spawnServer (/Users/mst49/workspace/sps-ui/node_modules/@prettier/plugin-ruby/src/parseSync.js:155:11)
at parseSync (/Users/mst49/workspace/sps-ui/node_modules/@prettier/plugin-ruby/src/parseSync.js:180:18)
at Object.parse (/Users/mst49/workspace/sps-ui/node_modules/@prettier/plugin-ruby/src/plugin.js:85:16)
at Object.parse (/Users/mst49/workspace/sps-ui/node_modules/prettier/index.js:7361:23)
at coreFormat (/Users/mst49/workspace/sps-ui/node_modules/prettier/index.js:8672:18)
at formatWithCursor2 (/Users/mst49/workspace/sps-ui/node_modules/prettier/index.js:8864:18)
at /Users/mst49/workspace/sps-ui/node_modules/prettier/index.js:39174:12
at Object.format (/Users/mst49/workspace/sps-ui/node_modules/prettier/index.js:39188:12)
at t.default.format (/Users/mst49/.vscode/extensions/esbenp.prettier-vscode-9.5.0/dist/extension.js:1:13489)
at async t.PrettierEditProvider.provideEdits (/Users/mst49/.vscode/extensions/esbenp.prettier-vscode-9.5.0/dist/extension.js:1:10196)
at async z.provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:105121)
["INFO" - 2:50:58 PM] Formatting completed in 5.201ms.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
kddnewton commentedon May 12, 2022
Have you installed the requisite gems from the README?
kddnewton commentedon May 14, 2022
I'm going to assume it's the gems that aren't installed. Let me know if that doesn't fix it and I'll reopen.
nadnoslen commentedon May 14, 2022
I'm also experiencing this timeout problem after allowing Dependabot to upgrade from
2.1.0to3.1.2.I thought it would be an easy fix after following @kddnewton's advice by installing the additional gems that I had no idea were required ...
... perhaps the changelog should mention this breaking change for developer's using node
prettier? I'd fork and update theprettier/plugin-rubychangelog myself, but I'm not 100% confident in my suggesting that edit until I fix this problem locally for myself.After installing the additional gems, I'm now able to format from the command line 👍
Unfortunately formatting from VS Code continues to time out with the same error reported by @tripptuttle. I've reloaded my VS Code project with no success. I must be missing something.
My rubocop is also blowing up with
Style/StringLiteralserrors likely because it can't seem to inherit the rubocop config file which appears to have been in3.1.1🤷♂️I'm heading back to
2.1.0for now.I hope some of my experience helps diagnose the problem. Thanks for this great formatting extension which has been terrific up to this little speed-bump.
oboje commentedon May 22, 2023
the same context, does not work for me
igz0 commentedon Aug 7, 2023
When VSCode is launched from Alfred, it times out.
In my environment, this does not occur when VSCode is started from the Applications directory.
This is probably due to permissions.