Comments (17)
I'm surprised that following code didn't help you. But you figured it out anyway so 👍
"reactSnap": {
"puppeteerArgs": ["--no-sandbox", "--disable-setuid-sandbox"]
}
from react-snap.
Main part of the log which you want to pay attention is:
/bin/sh: 1: react-snap: not found
Did you add react-snap to the dependencies? If issue is not solved, please open new ticket (to not spam people in this thread) and post contents of package.json
from react-snap.
@Jamez14 yes my example worked. You can clone repo, checkout branch and try it. I didn't push it to the master because Heroku uses HTTP1.
Pagerror - means that error happened inside the headless browser, what would you see in DevTools in chrome. Try build with react-snap, to see if this Heroku specific or not. You can open separate issue if you can provide reproducible demo, otherwise I can not do much about it
from react-snap.
This is what I got
git clone https://github.com/stereobooster/an-almost-static-stack.git
cd an-almost-static-stack
git checkout react-snap-heroku
heroku create
heroku config:set NPM_CONFIG_PRODUCTION=false
heroku buildpacks:add https://github.com/jontewks/puppeteer-heroku-buildpack.git
heroku buildpacks:add heroku/nodejs
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-static.git
git push heroku react-snap-heroku:master -f
...
remote: $ react-snap && yarn run generate-sw && yarn run generate-appcache
remote: (node:432) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
remote: /tmp/build_63bedf583edd7573cdc7d8cc8546b619/node_modules/puppeteer/.local-chromium/linux-555668/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory
remote:
remote:
remote: TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
remote:
remote: (node:432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I guess you need heroku config:set NPM_CONFIG_PRODUCTION=false
, because react-snap listed as devDependecy.
About issue with libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory
you need to ask in jontewks/puppeteer-heroku-buildpack
. It was working sometimes ago.
from react-snap.
I didn't try to deploy it to heroku, but quick googling gave me this recomendation:
"puppeteerArgs": ["--no-sandbox", "--disable-setuid-sandbox"]
Did you tried it?
PS. obviously you need heroku buildpack for puppeteer
from react-snap.
Thanks for your help, but I still can't get it to deploy, same error. It doesn't ever download the buildpack for puppeteer, so at this point I'm confounded. Adding puppeteerArgs
didn't help either, it seems like it just isn't getting the buildpack at all, which is odd. Much more likely that this issue is just me not knowing what I'm doing with this kind of deploy.
from react-snap.
What heroku buildpacks
says?
from react-snap.
Here are the build packs returned from the CLI command:
1. https://github.com/jontewks/puppeteer-heroku-buildpack.git
2. https://github.com/mars/create-react-app-buildpack.git
from react-snap.
Looks as it suppose to be. Maybe crosspost the issue to those buildpack repositories?..
from react-snap.
Will close this for now. Feel free to reopen
from react-snap.
create-react-app-buildpack - uses some magic with multi buildpack. Have you tried packages inside directly?
UPD: my try stereobooster/an-almost-static-stack#7
from react-snap.
@stereobooster were you able to get your heroku example working?
I got puppeteer running on my heroku instance but am receiving a nondescript error:
(Also if it would be better, I can open up a new issue for this, but Error: i
didn't seem like enough to go on)
from react-snap.
I haven't done any further testing, but I mentioned previously that I was not able to build/deploy with Heroku. I then forked react-snap
and manually added the puppeteer args and then react-snap
succeeded on Heroku. This might just be because of my project setup, but regardless someone else might find this useful.
from react-snap.
hey so i tried to do the same what you guys did but i still can't deploy at all
i added this to my package.json
"reactSnap": {
"puppeteerArgs": ["--no-sandbox", "--disable-setuid-sandbox"],
"concurrency": 1,
"inlineCss": false,
"puppeteerExecutablePath": "/usr/bin/chromium-browser"
}
and here is my log
yarn global add serve
serve -s build
$ react-snap
/bin/sh: 1: react-snap: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
from react-snap.
@Jamez14
so i have edited the same you told me
"reactSnap": {
"puppeteerArgs": ["--no-sandbox", "--disable-setuid-sandbox"],
"concurrency": 1,
"inlineCss": false,
"puppeteerExecutablePath": "/usr/bin/chromium-browser"
}
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "yarn run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"serve": "yarn npm-run-all -p watch-css start-js",
"heroku-postbuild": "yarn --production=true && yarn run build",
"build-js": "react-scripts build",
"build": "npm-run-all build-css build-js",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"flow": "flow",
"postbuild": "react-snap"
}
but i get the same error sadly
yarn global add serve
serve -s build
$ react-snap
/bin/sh: 1: react-snap: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
from react-snap.
@stereobooster
I disabled set the config to false like how you said and now i get the same error you get.
from react-snap.
solution for this
jontewks/puppeteer-heroku-buildpack#13 (comment)
from react-snap.
Related Issues (20)
- pagerror and incomplet crawled page with firestore HOT 4
- Problem with access to sitemap.xml
- Error in postbuild when using react-snap
- pageerror at /: SyntaxError: Unexpected token '.' HOT 8
- It is not rendering my css file on my 404 page HOT 1
- options.waitFor freezes crawling/rendering
- YouTube Video Embed Causing Error: DOMEXception: A network error occured. HOT 1
- Home page always being returned HOT 7
- Getting Same Page source for every page HOT 3
- Continue on error HOT 1
- Disable Crawling External JS such as Adsense and Analytics
- Support Vite.JS HOT 4
- Who uses it HOT 4
- There is a phenomenon in which the build does not end in the GitHub Actions (Linux Latest) environment. HOT 9
- React 18 not working ! HOT 10
- Not able to deploy on AWS Amplify HOT 3
- react-snap vulnerability
- SyntaxError: Unexpected token '?' HOT 8
- Getting react-app to work
- Prime React UI Kit Not Working With React Snap HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-snap.