Skip to content

require is not defined - then JS error - on linkedin.com #457

@gianpaj

Description

@gianpaj

Awesome project!

❯ ./lightpanda serve --host 127.0.0.1 --port 9222
info(server): accepting new conn...
info(server): client connected
info(browser): GET https://linkedin.com/ 200
info(browser): fetch https://static.licdn.com/aero-v1/sc/h/9gvyiifl4yl9bn197d0b77u8e: http.Status.ok
info(browser): eval script https://static.licdn.com/aero-v1/sc/h/9gvyiifl4yl9bn197d0b77u8e: ReferenceError: require is not defined
info(browser): fetch https://static.licdn.com/aero-v1/sc/h/5c81icanok4a9if4xo1qkuq7c: http.Status.ok
https://static.licdn.com/aero-v1/sc/h/5c81icanok4a9if4xo1qkuq7c:25493: Uncaught TypeError: e.getBoundingClientRect is not a function
https://static.licdn.com/aero-v1/sc/h/5c81icanok4a9if4xo1qkuq7c:330108: Uncaught TypeError: Cannot read properties of undefined (reading 'disableJsbeaconPagekeySuffix')
error(server): JS error
error(server): JS error
info(server): accepting new conn...
error(server): JS error
...

Then error(server): JS error keeps printing forever

I got this with this version on macOS

./lightpanda version
7b775d2

index.js

'use strict'

import puppeteer from 'puppeteer-core';

// use browserWSEndpoint to pass the Lightpanda's CDP server address.
const browser = await puppeteer.connect({
  browserWSEndpoint: "ws://127.0.0.1:9222",
});

// The rest of your script remains the same.
const context = await browser.createBrowserContext();
const page = await context.newPage();

// Dump all the links from the page.
await page.goto('https://linkedin.com/');

await page.close();
await context.close();
await browser.disconnect();

Metadata

Metadata

Assignees

Labels

CDPChrome Debug ProtocolbugSomething isn't workingpuppeteer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions