stereobooster / react-snap

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

Why app.js is still linked in index.html after the prerender? #468

Open g-wozniak opened 4 years ago

g-wozniak commented 4 years ago

I am deploying my app to S3. From what I read behind the scenes, react-snap copies the original index.html to 200.html which is great because I can use it as a fallback.

After a successful build I am getting index.html nicely pre-rendered but due to the fact the link to app.js is still there, it all goes crazy as componentDidMount() Ajax requests are getting triggered etc.

Only when I manually delete that file (that causes 404 in index.html) - all works as expected. I am using webpack for compression that generates <script src="app/app.js?9784d337027f3150ee11"></script> in the original index.html (before react-snap execution) after <div id="app"></div> but before the end of <body>.

Does anyone encountered the similar issue? Any idea what I am doing wrong?

ricky11 commented 3 years ago

did you fix this? or not using this package anymore?