Hannes Hertach

Results 15 comments of Hannes Hertach

Thanks for your response. About the use case: You're right, maybe that was not the best example. In my use case, I'm essentially loading a bunch of "widgets" (between 5...

I agree - leaving it open for a while sounds like a good plan.

Thanks, makes sense. It just threw me off and took me a while to debug because the error message wasn't particularly useful (`Fatal error: String index is out of bounds`...

Sorry, I didn't check the `package-lock` - we are actually already on 0.4.19. The line that fails is: ``` const pageContextJson = (_a = document.getElementById('vite-plugin-ssr_pageContext')) === null || _a ===...

So I deleted the `data-cmp-data-layer` attribute, and now the script is being placed in a different strange location: ``` {} window.$RefreshSig$ = () => (type) => type window.__vite_plugin_react_preamble_installed__ = true...

> Let's dig further. I will try a couple of things and let you know if I find anything insightful

~I changed the dev server to not use streaming:~ ~This was before:~ ``` const pageContext = await renderPage(pageContextInit); const { httpResponse } = pageContext; httpResponse.pipe(res); ``` ~I changed it to:~...

``` ... vps:stream user stream ended vps:stream vps end injection written vps:stream vps wrapper stream ended ``` This looks good.

> It should always inject at stream end: Looks like its injecting at stream start. I added a console log here https://github.com/brillout/vite-plugin-ssr/blob/a5b4bd678e06e6d3430750e0be15633e7dd3c665/vite-plugin-ssr/node/html/injectAssets/injectHtmlSnippet.ts#L15 to verify that the injection is actually the...

> This looks good. I logged the `htmlSnippetsAtBegin` and `htmlSnippetsAtEnd` variables in https://github.com/brillout/vite-plugin-ssr/blob/a5b4bd678e06e6d3430750e0be15633e7dd3c665/vite-plugin-ssr/node/html/injectAssets.ts#L76. ``` htmlSnippetsAtBegin = [ { htmlSnippet: [Function: htmlSnippet], position: 'STREAM' }, { htmlSnippet: '\n' + 'import RefreshRuntime...