Reputation: 1087
I'm using Prettier, along with the plugin prettier-plugin-apex
in VS Code, to format Salesforce classes and Visual Force pages etc.
It works (formats my docs on Save) most of the time, but now some, but not all, VF Pages (.page files) are failing to format with this error:
[Error - 10:42:57 AM] Request textDocument/rangeFormatting failed.
Message: Request textDocument/rangeFormatting failed with message: js_source_text is not defined
Code: -32603
I've searched for this error, and even just for Request textDocument/rangeFormatting failed with message: js_source_text is not defined
with nothing really useful returned.
It's really quite odd that it works for some files and not others, even though they have the same extension.
Any ideas what's going and how I can fix this?
Upvotes: 0
Views: 344
Reputation: 21
As this issue for Visualforce extension suggests, the Visualforce Lanaguage Server fails to format Visualforce page/component only if the code contains <style> . . . . </style>
tag(s).
Not an answer to your question, unfortunately, but I am unable to add this as a comment (not enough reputation on this particular StackOverflow site).
Upvotes: 0