Closed vemundeldegard closed 5 years ago
The interesting part is that it is not react-snap
fails, it is react-scripts build
. I removed all calls of react-snap
and it still fails https://codesandbox.io/s/lqryym71m
This seems to be an issue of create-react-app. Also related https://github.com/GoogleChrome/puppeteer/issues/3466
UPD
If I edit ./node_modules/puppeteer/lib/WebSocketTransport.js
and add throw new Error()
I don't see this error, so file is not executed, it just being parsed by some tool. My guess this is webpack parsing node_modules.
Reported in create-react-app https://github.com/facebook/create-react-app/issues/6510
I found the error. You need to put this in separate file (script for node) not in the code of web application
import run from "react-snap";
run({
include: ["/", "/kontakt-oss", "/blogg"]
});
Would you recommend putting it inside the "ws" file?
I'm not using "react-snap" but I'm getting the same errors using puppeteer with CRA.
Bug Report
Current Behavior Trying to include pages from my CMS into the "include" part of React-snap. Getting this error:
The only code I added was:
Reproducible demo Here is a demo https://codesandbox.io/s/zk5w0m5r3l
Expected behavior/code Trying to use react-snap programatically to add routes and make sure that they are crawled.
Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.