at the end of body tag The same" /> at the end of body tag The same" /> at the end of body tag The same"/>

React Loadable SSR - chunks are loading twice

480 Views Asked by At

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?

1

There are 1 best solutions below

0
Pranab Gupta On

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.