Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The example in README is not working anymore #11

Open
LuisPaGarcia opened this issue Aug 8, 2023 · 5 comments
Open

The example in README is not working anymore #11

LuisPaGarcia opened this issue Aug 8, 2023 · 5 comments

Comments

@LuisPaGarcia
Copy link

Hi! I'm trying to test the example from the README file, but is now working anymore.

~ npx puppeteer-heap-snapshot query -u https://www.instagram.com/p/CVEJmFTgdRw/ -p video_view_count,video_play_count,shortcode,video_url --no-headless | jq .

>> Opening Puppeteer page at: https://www.instagram.com/p/CVEJmFTgdRw/
>> Taking heap snapshot..
[]
➜  ~
@escodel
Copy link

escodel commented Aug 8, 2023

Same. Getting the following error from within StackBlitz:

Error: Could not find Chrome (ver. 115.0.5790.170). This can occur if either
 1. you did not perform an installation before running the script (e.g. `npm install`) or
 2. your cache path is incorrectly configured (which is: /home/.cache/puppeteer).
For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.

Are puppeteer and/or chromium itself required to be installed first?

@LuisPaGarcia
Copy link
Author

@escodel Yes, puppeteer is a pre-requisite for this. And puppeteer will install chromium under the hood. Maybe puppeteer-heap-snapshot assume you already have puppeteer installed.

@rmonvfer
Copy link

rmonvfer commented Aug 9, 2023

I also have the same issue, maybe we could try to figure out if instagram has made any changes to the property names. If @adriancooney could point us in the right direction would be great, because I've been trying to manually reproduce the original blog post but to no avail.

@escodel
Copy link

escodel commented Aug 9, 2023

I'm using "type": "module" for ESM in my package.json, but for some reason it's saying 'export' is an unexpected token from puppeteer-heap-snapshot. Found this StackOverflow answer that says there could be an issue with TS types?

Also noticed this PR #10 was opened a few weeks back, especially because syntax was incorrect for puppeteer method .goto() but still can't find a true solution 🤷‍♂️

@Bialogs
Copy link

Bialogs commented Aug 9, 2023

@escodel I had the same issue with respect to export and can recommend just using as common js and don't bother with esm as it seems broken at the moment.

const puppeteer = require('puppeteer');
const phs = require('puppeteer-heap-snapshot');
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://github.com/adriancooney/puppeteer-heap-snapshot');
const heapSnapshot = await phs.captureHeapSnapshot(page.target());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@Bialogs @escodel @LuisPaGarcia @rmonvfer and others