react-snap icon indicating copy to clipboard operation
react-snap copied to clipboard

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

Open g-wozniak opened this issue 4 years ago • 1 comments

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?

g-wozniak avatar May 24 '20 09:05 g-wozniak

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

ricky11 avatar Apr 30 '21 17:04 ricky11