Pranab Gupta
Pranab Gupta

Reputation: 360

React Loadable SSR - chunks are loading twice

I am adding js chunks in html using below tag

<script crossorigin defer type="text/javascript" src="<chunk>"></script>

at the end of body tag

The same chunk is being loaded again from the UI script.

I am using v5.4.0 of react-loadable.

Has anyone seen the same behaviour?

Upvotes: 0

Views: 506

Answers (1)

Pranab Gupta
Pranab Gupta

Reputation: 360

I missed this point from the docs. Now all chunk files script tags are added before main script tag.

It is important that the bundles are included before the main bundle, so that they can be loaded by the browser prior to the app rendering.

Upvotes: 0

Related Questions