Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

"Unexpected end of JSON input" -Win10 VS Code 1.54.1 #50

Open
emdashdrupal opened this issue Mar 9, 2021 · 15 comments
Open

"Unexpected end of JSON input" -Win10 VS Code 1.54.1 #50

emdashdrupal opened this issue Mar 9, 2021 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@emdashdrupal
Copy link

I had Vale working within VS Code and then it suddenly stopped. I'm not sure what/if anything changed.

The only error I see is "Unexpected end of JSON input"

Windows 10
vale version 2.9.1 (directly downloaded)
VS Code 1.54.1

.vale.ini
StylesPath = "h:/vale/styles"

[*.md]
BasedOnStyles = Vale, (still doesn't work only with Vale selected)

@emdashdrupal
Copy link
Author

I tested this on a separate VS Code install that never had Vale or the extension installed and can confirm similar results.

StylesPath = styles

Vocab = Blog

[*]
BasedOnStyles = Vale, Microsoft

@ChrisChinchilla ChrisChinchilla self-assigned this Mar 10, 2021
@jdkato
Copy link
Member

jdkato commented Mar 22, 2021

I think this might be the same issue as #49.

@ChrisChinchilla
Copy link
Collaborator

Can you confirm if this is now fixed after upgrading to Vale 2.10.2 @emdashdrupal ?

@emdashdrupal
Copy link
Author

Can you confirm if this is now fixed after upgrading to Vale 2.10.2 @emdashdrupal ?

Unfortunately, no, it still persists.

@ChrisChinchilla
Copy link
Collaborator

@emdashdrupal I tested Vale 2.10.2 on a vanilla Windows installation, with the ini file from above (minus the style path) and it worked as expected. My only other thought is that you maybe have some styles in the style path that are malformed?

@jdkato jdkato added the bug Something isn't working label Apr 15, 2021
@kbatuigas
Copy link

Hi, I'm experiencing this issue as well. I'm using Windows 10, Vale 2.10.2, VS Code 1.55.2. I was initially trying this with my own project where I had no styles added and all I had in my .vale.ini was BasedOnStyles = Vale, but even with the boilerplate repo I'm still getting SyntaxError: Unexpected end of JSON input from Vale output.

@jdkato
Copy link
Member

jdkato commented May 2, 2021

Could you try running vale ls-config from the root directory on the command line? My guess is that the StylesPath doesn't exist.

@kbatuigas
Copy link

Hi, this is what I see:

PS C:\> vale ls-config
E100 [.vale.ini] Runtime error

open : The system cannot find the file specified.

Execution stopped with code 1.
{
  "BlockIgnores": {},
  "Checks": null,
  "Formats": {},
  "GBaseStyles": null,
  "GChecks": {},
  "IgnoredClasses": null,
  "IgnoredScopes": null,
  "MinAlertLevel": 1,
  "Project": "",
  "RuleToLevel": {},
  "SBaseStyles": {},
  "SChecks": {},
  "SkippedScopes": null,
  "Stylesheets": {},
  "StylesPath": "",
  "TokenIgnores": {},
  "WordTemplate": "",
  "DictionaryPath": ""
}
2021/05/03 09:05:35 E100 [.vale.ini] Runtime error

open : The system cannot find the file specified.

Execution stopped with code 1.

@jdkato
Copy link
Member

jdkato commented May 3, 2021

This means that Vale can't find your .vale.ini file. Do you have one in a parent directory of the files you're editing?

@kbatuigas
Copy link

Yup, I do! There is one personal project where I've added .vale.ini to the project root, and I have the vale-boilerplate repo as well and I've left .vale.ini in the project root too.

@cbelsole
Copy link

I fixed this by copying the folder structure of the example repo.

styles > Vocab > Blog

That's what vale is expecting. The error could be better, but I don't think this is a bug.

@alexwine36
Copy link

I am having the same problem on Mac using Vale v2.20.1 and plugin version v0.15.2

Running vale ls-config returns
{
"BlockIgnores": {},
"Checks": [
"write-good.E-Prime",
"Google.Headings",
"Google.Acronyms",
"Google.Latin",
"Google.Exclamation",
"Google.Units"
],
"Formats": {
"mdx": "md"
},
"Asciidoctor": {},
"FormatToLang": {},
"GBaseStyles": null,
"GChecks": {},
"IgnoredClasses": null,
"IgnoredScopes": null,
"MinAlertLevel": 0,
"Vocab": [
"Base"
],
"RuleToLevel": {
"Google.Exclamation": "warning",
"Google.Units": "warning"
},
"SBaseStyles": {
".{md,mdx}": [
"Vale",
"Google",
"proselint",
"write-good",
"AlexStyle",
"alex",
"Joblint"
]
},
"SChecks": {
"
.{md,mdx}": {
"Google.Acronyms": false,
"Google.Exclamation": true,
"Google.Headings": false,
"Google.Latin": false,
"Google.Units": true,
"write-good.E-Prime": false
}
},
"SkippedScopes": null,
"Stylesheets": {},
"StylesPath": "/Users/alexanderwine/Documents/Programming.nosync/Node/NX/portfolio/.github/styles",
"TokenIgnores": {},
"WordTemplate": "",
"DictionaryPath": "",
"NLPEndpoint": ""
}

@phxnsharp
Copy link

Using GitHub Codespaces, Vale 2.20.2, Vale-VSCode 0.15.2. Vale works fine by itself from the command line with a variety of ways of calling it. The only message I get from the UI is "SyntaxError: Unexpected end of JSON input", not even a stack trace. I would really love to have this integration! Some type of way to turn up the logging to know what it is trying to do might help.

@phxnsharp
Copy link

In case someone else finds this useful, my problem was that it does not accept the '~' character in the path to vale in the plug-in settings (in case Vale is not installed to your path). Using the full path works.

This is a classic case of not reporting proper errors to the user. If the vale log window had said command "~/vale/vale" not found, I would have self-solved this in minutes instead of a day later.

@JulienMartens
Copy link

JulienMartens commented Dec 2, 2022

In case it helps someone : I installed Vale following the official tutorial and ran into the same "Unexpected end of JSON input" error.

After a lot of searching, I realised that the tutorial makes you install an older version of Vale(2.15.4)...getting the newest version from here solved the issue ! (Version 2.21.2)

Updating the vale.sh tutorial might be a good idea to prevent other people from falling in the same trap 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants