stereobooster / react-snap

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

CRA 3 not loading/hydrating javascript: The resource (*.chunk.js) was preloaded using link preload but not used within a few seconds from the window's load event. #438

Closed kmcaloon closed 4 years ago

kmcaloon commented 4 years ago

So everything is working beautifully apart from my app not hydrating after loading as you can see on my demo site: https://neutrino-server.site/courses/basic-flight-training/tampa-fl/

Not sure where to even start here. I took a look at similar issues i.e. #264 but nothing seems to be working for me. For what it is worth I am using a custom craco config and running react-snap programmatically after everything is finished:

    compiler.hooks.done.tap( 'React Snap Plugin', stats => {

      ReactSnap.run( {
        inlineCss: true,
        asyncScriptTags: true,
        //fixWebpackChunksIssue: false,
      } );

    } );

The problem occurs no matter how I configure the options. Any idea how I can start troubleshooting?

pacarvalho commented 4 years ago

@kmcaloon Were you able to solve your issue?

kmcaloon commented 4 years ago

Sorry @pacarvalho this was a while back and have since switched to Gatsby for other reasons. I don't think I was able to solve this though.

nandorojo commented 4 years ago

I'm still seeing this issue. Did anyone fix it?

Update turns out it works for me, but only if I use serve -s build. I thought this lib let you serve the index.html as an HTML file without needing a server, but I guess I misunderstood.