puppeteer-heroku-buildpack icon indicating copy to clipboard operation
puppeteer-heroku-buildpack copied to clipboard

mv: cannot stat '/app/.cache/puppeteer': No such file or directory

Open opeyemidy opened this issue 2 years ago • 19 comments
trafficstars

 > mkdir ./.cache && mv /app/.cache/puppeteer ./.cache
       
mv: cannot stat '/app/.cache/puppeteer': No such file or directory
-----> Build failed

opeyemidy avatar Jul 18 '23 15:07 opeyemidy

running into the same issues. Have you seen this issue yet? @jontewks

CryptoTuck avatar Aug 25 '23 20:08 CryptoTuck

I had to downgrade puppeteer

opeyemidy avatar Aug 26 '23 17:08 opeyemidy

@opeyemidy Downgrade to which version?

ElitKondor avatar Sep 04 '23 16:09 ElitKondor

@ElitKondor "puppeteer": "^16.2.0",

opeyemidy avatar Sep 04 '23 17:09 opeyemidy

@opeyemidy It really helped. Thanks!

ElitKondor avatar Sep 10 '23 11:09 ElitKondor

This fixed it for me: Make sure the puppeteer buildpack is placed before the node js:

  1. Puppeteer
  2. NodeJS

For your package.json, add this line as the last thing to do after building everything else

 "scripts": {
    "build": "node node_modules/puppeteer/install.js && mkdir -p ./.cache && mv /app/.cache/puppeteer ./.cache",
}

before deploying: heroku builds:cache:purge -a YOUR_APP

skyf0xx avatar Sep 15 '23 06:09 skyf0xx

@hitwill does it work with the latest version of puppeteer?

opeyemidy avatar Sep 15 '23 07:09 opeyemidy

having the same issue here :/

geniuscd avatar Sep 22 '23 18:09 geniuscd

I downgraded puppeteer to "puppeteer": "^16.2.0" and did not use presented script command. The rest is the same as hitwill said. As heroku puppeteer buildpack i'm using a link to this repo ("https://github.com/jontewks/puppeteer-heroku-buildpack"). Don't remember to reorder buildpacks (Puppeteer -> Node) and redeploy something to make these changes work

ElitKondor avatar Sep 25 '23 16:09 ElitKondor

@hitwill does it work with the latest version of puppeteer?

@opeyemidy yes. I am using: "puppeteer": "^21.2.0"

skyf0xx avatar Oct 01 '23 22:10 skyf0xx

@hitwill

i'm getting this

Error: Cannot find module '/tmp/build_25b7743d/node_modules/puppeteer/install.js'

opeyemidy avatar Oct 03 '23 23:10 opeyemidy

install

@opeyemidy try node node_modules/puppeteer/install.mjs

(mjs instead of js)

skyf0xx avatar Oct 04 '23 11:10 skyf0xx

worked thanks @hitwill

opeyemidy avatar Oct 04 '23 12:10 opeyemidy

@hitwill how were you able to find the solution? thank you!

nazreen avatar Dec 10 '23 04:12 nazreen

ok I am facing a weird thing where,

if I purge, then trigger a deploy, it would work

but then if there is another deploy triggered, it would complain about the same error that is the title of this issue

nazreen avatar Dec 10 '23 04:12 nazreen

ok I am facing a weird thing where,

if I purge, then trigger a deploy, it would work

but then if there is another deploy triggered, it would complain about the same error that is the title of this issue

Follow the conversation from here

@hitwill how were you able to find the solution? thank you!

Follow the conversation from here: https://github.com/jontewks/puppeteer-heroku-buildpack/issues/130#issuecomment-1720774565

skyf0xx avatar Jan 08 '24 04:01 skyf0xx

Thank you @hitwill 🙏

Agill-Sheron avatar Jan 30 '24 18:01 Agill-Sheron

@hitwill You seem to be the guru around here. I made sure the build pack was before NodeJS, added the script to .json file (used mjs) and then purged. Does this not all apply if using Next.js? I keep getting this in the logs

"[Error:` ENOENT: no such file or directory, open '/app/.next/BUILD_ID']"

and this..

State changed from starting to crashed at=error code=H10 desc="App crashed".

Is this just other non relevant issues maybe?

zachsj avatar Feb 27 '24 22:02 zachsj

I got it to work by following creating a .cjs file etc from this post https://stackoverflow.com/questions/52225461/puppeteer-unable-to-run-on-heroku

Having some other cloudinary api_key issues now though.

zachsj avatar Feb 29 '24 17:02 zachsj

Sorry for slow response here, but looked like it was working in a newer version of puppeteer. I'm also going to update this buildpack for the latest version of heroku, so will be sure latest heroku and latest puppeteer have all the kinks worked out.

jontewks avatar Jul 20 '24 19:07 jontewks