stereobooster / react-snap

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

Temporal scripts got bundled #346

Closed theKashey closed 5 years ago

theKashey commented 5 years ago

Bug Report

Final HTML got saved as-is, while it might contain some data usable only by puppeteer.

<html>
<head>
    <script src="main.3f3e7a70.js" defer></script>
    <!-- react-snap would inject chunks script here -->
    <!-- links would be broken for localhost, but valuable for real server -->
    <!-- in any case hydration will took a place only after all data loaded -->
    <script src="http://localhost:45678/splitted-1.a34dceb3.js" async charset="utf-8" type="text/javascript"></script>
    <script src="http://localhost:45678/splitted-2.3981cca3.js" async charset="utf-8" type="text/javascript"></script>
    <script src="http://localhost:45678/splitted-3.06956975.js" async charset="utf-8" type="text/javascript"></script>
</head>

Reproducible demo

https://github.com/theKashey/react-imported-component/tree/master/examples/hybrid/react-snap

Expected behavior/code all "broken this way" resources shall be removed, or url should be "cleaned"

Possible Solution

I've tried removeScripts option, but it leads to a runtime error.

stereobooster commented 5 years ago

It seems I fixed it https://github.com/theKashey/react-imported-component/compare/master...stereobooster:346-add-parcel-support?expand=1.

theKashey commented 5 years ago

So that was a parcel issue. :awesome: