elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
9.74k stars 207 forks source link

SyntaxError: export 'Html' not found in '@kitajs/html' #759

Closed entrptaher closed 1 month ago

entrptaher commented 1 month ago

What version of Elysia.JS is running?

"elysia": "^1.1.4"

What platform is your computer?

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Simply install @elysiajs/html as per the doc.

import { Elysia } from "elysia";
import { html } from "@elysiajs/html";

new Elysia()
  .use(html())
  .get(
    "/html",
    () => `
            <html lang='en'>
                <head>
                    <title>Hello World</title>
                </head>
                <body>
                    <h1>Hello World</h1>
                </body>
            </html>`
  )
  .get("/jsx", () => (
    <html lang="en">
      <head>
        <title>Hello World</title>
      </head>
      <body>
        <h1>Hello World</h1>
      </body>
    </html>
  ))
  .listen(30001);

What is the expected behavior?

No errors.

What do you see instead?

1 | (function (entry, fetcher)
    ^
SyntaxError: export 'Html' not found in '@kitajs/html'

Additional information

Seems a version specific problem from @kitajs/html in their latest version 4.2.0, the following to the package.json fixes this issue for now.

  "overrides": {
    "@kitajs/html": "4.1.0"
  }
x4132 commented 1 month ago

https://github.com/elysiajs/elysia-html/issues/91 Probably should put the issue in the plugin repo

x4132 commented 1 month ago

Fix unnecessary as kitajs 4.2.1 fixes the issue.

SaltyAom commented 1 month ago

Closing as kita 4.2.1 released