WebReflection / heresy-ssr

🔥 heresy 🔥 Server Side Rendering
ISC License
88 stars 1 forks source link

trouble rendering values #21

Closed ian-luca closed 4 years ago

ian-luca commented 4 years ago

When I try to render my page content with heresy-ssr I get the following error: Error: 2 values instead of 0

I guess somehow the Tagger expects document as target to have zero Holes?

The stacktrace _at /app/node_modules/domtagger/cjs/index.js:63:17 at /app/node_modules/domtagger/cjs/index.js:103:20 at unroll (/app/node_modules/lighterhtml/cjs/index.js:68:24) at render (/app/node_modules/lighterhtml/cjs/index.js:24:19) at render (/app/node_modules/heresy/cjs/index.js:207:33) at render (/app/nodemodules/heresy-ssr/cjs/index.js:112:9)

My application code

import express from "express"
import { document, render, html } from "heresy-ssr"

const app = express()

const lang = "en"
const dynamicScriptPath = "/some/path/to/js-file.js"

function renderIndexPage() {
  render(document, html`
    <html lang=${lang}>
      <head>
        <title>ianluca</title>
        <CustomElements/>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <script src=${dynamicScriptPath}></script>
      </head>
      <body>
      </body>
    </html>`
  )
}

app.get("/", (_, res) => {
  renderIndexPage()

  res.contentType("html")
    .send(document.toString())
})

app.listen(80)

The content delivered by the server

<!DOCTYPE html>
<html>
    <head>
        <title>ianluca</title>
        <script is="custom-elements"></script>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <script src="-0.757559%"></script>
    </head>
    <body>
    </body>
</html>
WebReflection commented 4 years ago

This bug was brought to myself via basicHTML.

I've no idea what's going in there, but I can confirm heresy-ssr is fixed now.