-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error formatting document: RangeError: Invalid count value #130
Comments
We are seeing the same thing in our project, and I believe I've tracked it down to a mismatch in expected return types in this try/catch block: prettier-plugin-erb/lib/formatter.js Lines 19 to 26 in 613fc24
What happens is In the case where prettier-plugin-erb/lib/formatter.js Lines 28 to 44 in 613fc24
That leads to an empty Here's an expression that can be used to trigger that behaviour: <%= call_a_method :any_method, "it really does not matter which one", as_long_as(the_line: "is very very long"), it_will: "fail" %> As for fixing it, replacing line 22 with |
FIxes the issue described in adamzapasnik#130. It seems that `embedTextToDoc` is returning a string and not an object with a `parts` array.
Im trying to get formatting for ERB files working. I enabled the extension "Prettier - Code formatter" in VS code. Then in terminal I installed the plugins:
In settings.json I have:
After reloading VS code, I tried to format a .erb file and I get an error:
The text was updated successfully, but these errors were encountered: