Skip to content

[Bug]: Engine JSON Parsing Error #157

@kenneypVL

Description

@kenneypVL

Describe the bug
When using puppeteer-with-fingerprints, the library crashes with a JSON parsing error. It looks like the remote engine is receiving undefined instead of a valid JSON response, which causes JSON.parse to fail.

Error Trace

undefined:1
undefined
^

SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at RemoteEngine.runFunction (C:\Users\myaccount\myinstalls\install_104-62\node_modules\browser-with-fingerprints\src\plugin\connector\engine.js:120:17)
    at async C:\Users\myaccount\myinstalls\install_104-62\node_modules\browser-with-fingerprints\src\plugin\connector\index.js:33:36

Node.js v22.11.0
C:\Windows\system32\WindowsPowerShell\v1.0\

Steps to reproduce
Steps to reproduce the behavior:

  1. Install puppeteer-with-fingerprints and run a basic script that launches a browser.
  2. Call a fingerprint function (e.g., launch with fingerprint injection enabled).
  3. The script immediately throws the above error.

Code example

import puppeteer from "puppeteer-with-fingerprints";

(async () => {
  const browser = await puppeteer.launch({
    headless: true,
  });

  const page = await browser.newPage();
  await page.goto("https://example.com");

  await browser.close();
})();

Expected behavior
The browser should launch normally with fingerprints applied, without throwing a JSON parsing error.

System (please complete the following information):
Plugin version: v2.3.3
Node version: v22.11.0
OS: Windows

Additional context
This only happens when using the fingerprints connector. It seems like something in engine.js is returning undefined instead of valid JSON, causing JSON.parse to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions