Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with injectScriptsAt: "STREAM" when integrating SolidJS's renderToStringAsync() for crawlers. #1856

Closed
phonzammi opened this issue Sep 6, 2024 · 0 comments · Fixed by #1857
Labels

Comments

@phonzammi
Copy link
Member

Description

When attempting to add support for checking crawlers/bots & integrate renderToStringAsync() to vike-solid in vikejs/vike-solid#117. We encountered a bug: You stumbled upon a Vike bug.

[17:05:52.522][/examples/solid-query][pnpm run dev][stderr] 5:05:52 PM [vike@0.4.193][request(2)][Bug] You stumbled upon a Vike bug. Go to https://github.com/vikejs/vike/issues/new and copy-paste this error. A maintainer will fix the bug (usually under 24 hours).
    at injectHtmlTagsToString (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/html/injectAssets.js:15:5)
    at renderDocumentHtml (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/html/renderHtml.js:38:32)
    at executeOnRenderHtmlHook (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js:33:24)
    at renderPageAlreadyRouted (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js:58:30)
    at renderPageNominal (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/renderPage.js:284:36)
    at renderPageAlreadyPrepared (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/renderPage.js:119:[45](https://github.com/vikejs/vike-solid/actions/runs/10742321893/job/29794694075?pr=117#step:8:46))
    at renderPageAndPrepare (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/renderPage.js:99:12)
    at file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/plugin/shared/getHttpRequestAsyncStore.js:54:35
    at renderPage (file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/runtime/renderPage.js:45:35)
    at file:///home/runner/work/vike-solid/vike-solid/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_/node_modules/vike/dist/esm/node/plugin/shared/addSsrMiddleware.js:30:27

This issue occurs when we have a +config.js file like this:

export default {
  stream: true,
  injectScriptsAt: "STREAM",
} satisfies Config;

We set injectScriptsAt: "STREAM", but renderToStringAsync() returns a string, not a stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant