Description
A clear and concise description of what the bug is.
Steps to Reproduce
- Write this code in
test.js
import { Readable } from "stream";
import { render } from "@lit-labs/ssr/lib/render-with-global-dom-shim.js";
import { html } from 'lit-html';
const template = ({ title }) => html`
<html>
<head>
<!-- remove the next line and it works -->
<title>${title}</title>
</head>
<body>
<p>${title}</p>
</body>
</html>
`;
const ssrResult = render(template({ title: "hello" }));
/***** HELPERS */
const stream = Readable.from(ssrResult);
const ssrString = await streamToString(stream);
console.log(ssrString);
function streamToString(stream) {
const chunks = [];
return new Promise((resolve, reject) => {
stream.on("data", (chunk) => chunks.push(Buffer.from(chunk)));
stream.on("error", (err) => reject(err));
stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
});
}
- execute it via
node test.js
Expected Results
the ssr output
Actual Results
$ node test.js
node:internal/process/esm_loader:94
internalBinding('errors').triggerUncaughtException(
^
Error: unexpected final partIndex: 1 !== 2
at renderTemplateResult (file:///html/test-ssr/node_modules/@lit-labs/ssr/lib/render-lit-html.js:514:15)
at renderTemplateResult.next (<anonymous>)
at renderValue (file:///html/test-ssr/node_modules/@lit-labs/ssr/lib/render-lit-html.js:354:16)
at renderValue.next (<anonymous>)
at render (file:///html/test-ssr/node_modules/@lit-labs/ssr/lib/render-lit-html.js:336:12)
at render.next (<anonymous>)
at next (node:internal/streams/from:86:20)
at Readable.readable._read (node:internal/streams/from:53:7)
at Readable.read (node:internal/streams/readable:487:10)
at flow (node:internal/streams/readable:1012:34)
Browsers Affected
Description
A clear and concise description of what the bug is.
Steps to Reproduce
test.jsnode test.jsExpected Results
the ssr output
Actual Results
Browsers Affected