mifi / mifi/SimpleInstaBot

Failed to run SyntaxError: Unexpected token < in JSON at position 0

Open
#286 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
692
Forks
103
Avg merge
3m
Merged PRs (30d)
4

Description

To Reproduce
Run the bot, login and get this error:

Screenshots
image

Desktop (please complete the following information):

  • OS: iMac Sonoma 14.6.1
  • Browser: Brave Browser
  • Version: v1.70.117

Additional context

  • No settings have been changed, they remain by default config.

Provide me with HTML
LOGS FROM LAST RUN
1:50 PMNo cookies found
1:50 PMSetting language to English (en)
1:50 PMWaiting 1.64 sec
1:50 PMWaiting 4.12 sec
1:50 PMFound language selector
1:50 PMAlready English language
1:50 PMWaiting 1.40 sec
1:50 PMNo login page button, assuming we are on login form
1:50 PMWaiting 1.00 sec
1:50 PMWaiting 1.68 sec
1:50 PMStill not logged in, trying to reload loading page
1:50 PMWaiting 9.06 sec
1:51 PMWARNING: Login has not succeeded. This could be because of an incorrect username/password, or a "suspicious login attempt"-message. You need to manually complete the process, or if really logged in, click the Instagram logo in the top left to go to the Home page.
1:51 PMWaiting 8.63 sec
1:51 PMWaiting 9.28 sec
1:51 PMWaiting 5.39 sec
1:51 PMWaiting 9.51 sec
1:51 PMWaiting 7.60 sec
1:51 PMWaiting 9.27 sec
1:51 PMSetting language to English (en)
1:51 PMWaiting 1.11 sec
1:52 PMWaiting 3.40 sec
1:52 PMFound language selector
1:52 PMAlready English language
1:52 PMSaving cookies
1:52 PMHave followed/unfollowed 0 in the last hour
1:52 PMHave followed/unfollowed 104 in the last 24 hours
1:52 PMHave liked 0 images in the last 24 hours
1:52 PMFailed to detect username Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'viewer')
at pptr://puppeteer_evaluation_script:1:34
1:52 PMTrying to get user data from HTML
1:52 PMNavigating to user -CENSORED-
1:52 PMGoto https://www.instagram.com/-CENSORED-
1:52 PMPage loaded
1:52 PMWaiting 2.77 sec
1:52 PMNeed to intercept network request to get user data
1:52 PMUnable to intercept request, will send manually
1:52 PMFailed to manually send request Error: Evaluation failed: SyntaxError: Unexpected token < in JSON at position 0
1:52 PMFailed to run SyntaxError: Unexpected token < in JSON at position 0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the login flow described in issue #286 and inspect the HTML returned when the bot tries to retrieve user data manually. Trace the failing JSON parse after the "Unable to intercept request" message; done means the login and user-data retrieval path completes without the SyntaxError.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.