"SyntaxError: Unexpected end of JSON input" in wrangler-dist/cli.js

This has happened a few times recently for me, after making some innocuous code changes. Restarting my PC seems to get rid of it, but it's annoying and I'm not sure what's causing it. Anyone any idea? Thanks in advance.
11 Replies
Walshy
Walshy3w ago
We'd need more info When are you seeing this error? Any other logs? Can you capture debug logs?
Mitya
MityaOP3w ago
Sorry, here's something to begin with:
No description
Mitya
MityaOP3w ago
What else can I do to provide the necessary info - how do I capture debug logs?
Walshy
Walshy3w ago
Ok it's on dev, already more helpful WRANGLER_LOG=debug for debug logs
Mitya
MityaOP3w ago
sec WRANGLER_LOG=debug gives "WRANGLER_LOG=debug: The term 'WRANGLER_LOG=debug' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again." Ah, probably why a system restart fixes it
Walshy
Walshy3w ago
Yeah seems to be trying to access the inspector --no-inspector I think disables it and should avoid the path
Mitya
MityaOP3w ago
--no-inspector > "Unknown argument: inspector" With the command: wrangler dev --config \"dev.toml\" --remote --port 1933 --env dev --no-inspector
Walshy
Walshy3w ago
Seems to be --inspect looking at the code
Mitya
MityaOP3w ago
Ah yes that fixes it. That doesn't show up under the list of options, interestingly. OK with no-inspect set, am I losing anything?
Walshy
Walshy3w ago
Just devtools
Mitya
MityaOP3w ago
Cool, thanks for the help. Much appreciated.

Did you find this page helpful?