molsonkiko / JsonToolsNppPlugin

A Notepad++ plugin providing tools for JSON like linting, querying, a tree view, and CSV conversion.
Apache License 2.0
85 stars 9 forks source link

always getting "no input at position 0" (TRY INSTALLING V5.6+, SEE IF THAT FIXES IT) #16

Open igpit opened 1 year ago

igpit commented 1 year ago

open json text file, do something from JsonTools menu, e.g. pretty print or show tree

Could not parse the document because of error no input at position 0 (char ' Screenshot_222

using npp 8.4.6 with latest jsontools, in "C:\Program Files\Notepad++\plugins\JsonTools\JsonTools.dll"

molsonkiko commented 1 year ago

Hi igpit, that's very strange! As I noted in response to issue #17 , I have not observed any unusual behavior when running JsonTools with the same setup as yours except for the differences noted in my first comment there.

Does this happen on all JSON files that you try to use it for, or can you show me examples where it does and doesn't fail?

igpit commented 1 year ago

re-tested JsonTools 4.1 on NPP 8.4.6 yields using "pretty print" on my MS teams desktop-config.json:

image

molsonkiko commented 1 year ago

Thanks for sticking with me despite this frustrating issue! I've tried playing around with the encoding of an example MS Teams desktop-config.json, and I even temporarily set my system language to German to see if any of those changes caused a similar error a similar document that the plugin previously handled fine. No change short of manually inserting a bad character has done anything. At some point I will try setting up a remote desktop to see if I can test the plugin on another machine.

igpit commented 1 year ago

it seems not to be related to any json content. this even happens with a empty document.

sanghel-orbyta commented 1 year ago

can confirm this issue

can this be caused by having other JSON related plugins installed?

image image

molsonkiko commented 1 year ago

I just tried install JSON Viewer and JSTool and none of them interfere with this plugin in any way (aside from making Alt-based keyboard shortcuts harder to use).

I'm not going to close this issue, but I really have absolutely no idea how to solve this problem, because I can't replicate it on my machine. At one point I tried spinning up a Windows AWS instance to see if I could replicate it elsewhere, but:

  1. I found it really hard to spin up a Windows AWS instance for some reason
  2. That likely wouldn't even allow me to replicate your problem.

If some other developer who can replicate the issue wants to fix this problem for me, I'd be delighted. But I can't help you.

In light of this, I recommend that you look at some of the alternative tools I've listed in the README. All of them seem based on my testing to work fine.

molsonkiko commented 1 year ago

If anyone who's had this issue feels like pursuing it further, maybe they could leave their computer's debug info (?->Debug Info... from the main menu bar) as a comment here, so that someone (including maybe me when I'm feeling less pessimistic) can hopefully narrow down what the issue might be?

For the record, here's mine:

Notepad++ v8.4.8   (64-bit)
Build time : Dec 24 2022 - 19:40:27
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit) 
OS Version : 22H2
OS Build : 19045.2486
Current ANSI codepage : 1252
Plugins : 
    AnalysePlugin (1.13.49)
    ComparePlugin (2.0.2)
    CSVLint (0.4.6.1)
    CsvQuery (1.2.9)
    EnhanceAnyLexer (1.1.3)
    HTMLTag (1.3.5)
    HugeFiles (0.1.1)
    JsonTools (4.9.0.1)
    mimeTools (2.9)
    NppConverter (4.5)
    NppExport (0.4)
    PythonScript (3.0.15)
    urlPlugin (1.2)
    XMLTools (3.1.1.13)
DongJu-Na commented 1 year ago

How can i solve this problem?

I am having the same problem.

molsonkiko commented 1 year ago

Hi all, I think I may have solved it (fingers crossed!)

A bug that was making this plugin incompatible with Notepad++ older than 8.4.1 was fixed, and that may have been what was going wrong for you.

Try the DLLs here:

ctidrv commented 11 months ago

Debug info as requested. I have the same error.

Build time : Oct 15 2023 - 21:12:23
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line : "C:\Program Files (x86)\Notepad++\change.log" 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 11 Enterprise (64-bit)
OS Version : 22H2
OS Build : 22621.2506
Current ANSI codepage : 1252
Plugins : 
    DSpellCheck (1.4.20)
    JsonTools (4.4)
    mimeTools (2.9)
    NppConverter (4.5)
    NppExport (0.4)

EDIT: Ignore this. I just installed this tool today, but it installed 4.4???? Notepad++ now shows an update to 5.6 which does resolve the issue for me.

molsonkiko commented 11 months ago

ctidrv said

Notepad++ now shows an update to 5.6 which does resolve the issue for me.

Thanks so much for letting me know that, @ctidrv ! Anybody else having this issue: try upgrading to release 5.6, or better yet, the latest release.

I'd be interested to see if this issue is fixed for other people as well! I'd also be curious to know what was the earliest release where this was fixed, though I certainly don't expect anyone to do this for me.

bobby-driggs commented 10 months ago

Can confirm updating solved the issue for me. Started randomly getting this error a week or two ago.

I noticed I was on JSON Tools version 4.X.X, and Notepad++ version 8.4.X. There was not a way to update to JSON tools 5.6, so I just unistalled the plugin, updated NPP to 8.6, and I was able to reinstall the JSON Tools plugin @ version 5.6 and issue went away!

Thanks!