Closed Coachonko closed 2 months ago
Ok, I will watch it soon. I need a little time to dive into the problem.
However, it's also worth noting that I wouldn't recommend using document
as the application's hydration point, because any browser extension will break everything due to not being represented in the Fiber tree.
Is there a use for bootstrapScripts
when not hydrating the whole document? One could manually add the
renderToStream
'sbootstrapScripts
does not mark scripts with thetype="module"
attribute. In the event that the browser bundle is loaded on the browser via this way, loading routes using thelazy
function will not work, browsers will throw errorUncaught SyntaxError: Cannot use import statement outside a module (at index.js:1:1)
Suggested change: add
bootstrapModules
property toRenderToStreamOptions
that accepts an array of string just likebootstrapScripts
except the resulting output would be<script type="module" src="${script}" defer></script>
instead of just<script src="${script}" defer></script>
Example of the issue is demonstrated here