Skip to content

Conversation

@mfkl
Copy link
Contributor

@mfkl mfkl commented Jul 14, 2025

When trying to push a nuget package containing an icon and a readme inside the nupkg (such as libvlcsharp), I'm hitting the following error:

Unexpected character encountered while parsing value: �. Path '', line 0, position 0 

You can reproduce and catch the exception here

var json = await JObject.LoadAsync(jsonReader, _jsonLoadSettings);

readmes and icons are under the form of bc843690-b6b7-44f9-9527-bab8a374809e\07e7da76-8654-4d33-8f2f-aa9dafec230b.tmp for LocalCacheFile.FullName and the current if logic is not detecting them early enough, so I just moved them around.

Unexpected character encountered while parsing value: �. Path '', line 0, position 0.
at Sleet.JsonUtility.<LoadJsonAsync>d__13.MoveNext() in Sleet\src\SleetLib\Utility\JsonUtility.cs:line 181
@emgarten
Copy link
Owner

Is your icon or readme also json allowing it to pass the check?

This looks like a good fix overall, those files should be checked first before the more generic cases.

@emgarten emgarten merged commit 477c0ec into emgarten:main Jul 15, 2025
4 checks passed
@emgarten
Copy link
Owner

This fix was released in v6.5.10

@mfkl
Copy link
Contributor Author

mfkl commented Jul 15, 2025

Is your icon or readme also json allowing it to pass the check?

No, they are regular png/markdown files, but with the code below, the json check runs (and fails) anyway:

else if (key.EndsWith(".json", StringComparison.Ordinal) || await JsonUtility.IsJsonAsync(LocalCacheFile.FullName))

Thanks for the quick merge.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants