Reputation: 1671
I have an app that works in the following way:
/client/app/public/build
.After I run yarn run build
and the postbuild
script is executed, it fails immediately with the following error:
yarn run v1.9.4
$ react-snap
events.js:183
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open '/Users/aington/git/static-help/build/index.html'
error Command failed with exit code 1.
This makes sense, since there are no files in that location.
I know that react-snap
prides itself on being a zero-configuration library, but I really would like to configure it so that it can point to the right directory for serving files. Additionally, the Express server provides an authentication library, so that needs to run too.
Is it realistic to expect that react-snap
can do this and still crawl and pre-render the site? Or should I explore other options?
Upvotes: 5
Views: 2627
Reputation: 61
Check the default options in index.js
and use it in package.json like the below
"reactSnap" : {
"source" : "./dist"
}
Upvotes: 6