-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Description:
When attempting to execute a command with mediumcli (as indicated by the <anonymous_script>:1 line), I'm encountering the following error:
SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON
at JSON.parse (<anonymous>)
at Request._callback (/usr/lib/node_modules/mediumcli/lib/post.js:28:20)
... (rest of the stack trace)
Context:
This error suggests that mediumcli is trying to parse an HTML response (which starts with <!doctype html>) as if it were JSON. This typically happens when the API or endpoint mediumcli is trying to access doesn't return the expected JSON, but rather an HTML page (e.g., an error page, a login page, or a gateway response).
Steps to Reproduce:
- Execute the
mediumcli <specific-command-that-caused-the-error>command (please replace<specific-command-that-caused-the-error>with the actual command you were running).
Expected Behavior:
mediumcli should successfully process the request, whether it's publishing a post, retrieving information, or any other action expected from the command.
Current Behavior:
mediumcli fails with a SyntaxError because it's receiving an HTML response instead of JSON.
Possible Causes (and suggested investigations):
- Authentication/Session Issue:
mediumclimight not be properly authenticated, leading to a redirect to an HTML login or error page. Double-check yourmediumclicredentials. - Network/Proxy Issue: A proxy or network problem could be intercepting the request and returning an HTML error page.
- Medium API Change: The Medium API might have changed how it returns data or the response structure, causing incompatibility with
mediumcli. mediumcliBug: There might be a bug withinmediumcliitself that prevents it from correctly handling certain API responses from Medium.
Additional Information:
- Node.js Version:
Node.js v23.11.1 - Operating System: Linux
- Location: Goiânia, Goiás, Brazil
- Date/Time of Error: Saturday, May 25, 2025, 1:25:40 PM -03
