stereobooster / react-snap

👻 Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
5.04k stars 391 forks source link

PUBLIC_URL set in package breaks react-snap #469

Open bogdancss opened 4 years ago

bogdancss commented 4 years ago

We have multiple build commands, each with its own PUBLIC_URL set. However, runningreact-snap fails and only crawls /:

⚠️ warning at /: got 404 HTTP code for https://emaple.com/custompath/static/js/2.e75ddbd9.chunk.js

️💬 console.log at /: Failed to load resource: the server responded with a status of 404 ()

✅ crawled 1 out of 1 (/)

TheLartians commented 3 years ago

I had the same problem and found the solution in a different issue. TLDR, remove the hostname from the PUBLIC_URL, e.g. PUBLIC_URL="https://emaple.com/custompath" -> PUBLIC_URL="/custompath".