elysiajs / elysia-html

A plugin for Elysia that add support for returning html
MIT License
24 stars 19 forks source link

Bug: Elysia 1.1.0 KitaJS HTML Issue #91

Open indrazm opened 1 month ago

indrazm commented 1 month ago

Hello,

So, there is an issue with @elysiajs/html version 1.1.0 which html is not available imported from @kitajs/html. it would be error like this .

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

The issue looks like the Html is not available in @kitajs/html.

Feel free to try and it still works on @elysiajs/html version 1.0.0

Thanks.

indrazm commented 1 month ago

The current solution is using version 1.0.0 Make sure you do this :

"@elysiajs/html": "1.0.0" 👍 
"@elysiajs/html": "^1.0.0" 👎 
sacsbrainz commented 1 month ago

I am also experiencing the same issues

$ bun run --watch src/index.ts
1 | (function (entry, fetcher)
    ^
SyntaxError: export 'Html' not found in '@kitajs/html'
1 | (function (entry, fetcher)
    ^
SyntaxError: export 'Html' not found in '@kitajs/html'
^C
1 | (function (entry, fetcher)
    ^
SyntaxError: export 'Html' not found in '@kitajs/html'
1 | (function (entry, fetcher)
1 | (function (entry, fetcher)
    ^
SyntaxError: export 'Html' not found in '@kitajs/html'
1 | (function (entry, fetcher)
    ^
SyntaxError: export 'Html' not found in '@kitajs/html'
 "@elysiajs/html": "^1.1.0",
 "elysia": "latest"
indrazm commented 1 month ago

Yes, you can use @sacsbrainz version 1.0.0

The current solution is using version 1.0.0 Make sure you do this :

"@elysiajs/html": "1.0.0" 👍 
"@elysiajs/html": "^1.0.0" 👎 
sacsbrainz commented 1 month ago

Yes, you can use @sacsbrainz version 1.0.0

The current solution is using version 1.0.0 Make sure you do this :

"@elysiajs/html": "1.0.0" 👍 
"@elysiajs/html": "^1.0.0" 👎 

didn't work either error:

$ bun run --watch src/index.ts
1 | (function (entry, fetcher)
    ^
SyntaxError: module '/home/sacs/Documents/dev/node_modules/@elysiajs/html/dist/index.js' does not have an export named 'default'. Did you mean 'html'?
1 | (function (entry, fetcher)
    ^
SyntaxError: module '/home/sacs/Documents/dev/node_modules/@elysiajs/html/dist/index.js' does not have an export named 'default'. Did you mean 'html'?
x4132 commented 1 month ago

https://github.com/kitajs/html/commit/6790818c4c694a9816bf7ccddc39779fa3afc8d1

This looks like the offending commit.

indrazm commented 1 month ago

Yep looks like that. I do suggest everyone to change the Html to JSX Element just like this.

interface Props {
    children: JSX.Element | JSX.Element[]
}

const Template = ({children}: Props) => {
   return (
       <div>{children}</div>
   )
}

You can always extends for the whole app using typescript definition file.

indrazm commented 1 month ago

Yes, you can use @sacsbrainz version 1.0.0

The current solution is using version 1.0.0 Make sure you do this :

"@elysiajs/html": "1.0.0" 👍 
"@elysiajs/html": "^1.0.0" 👎 

didn't work either error:

$ bun run --watch src/index.ts
1 | (function (entry, fetcher)
    ^
SyntaxError: module '/home/sacs/Documents/dev/node_modules/@elysiajs/html/dist/index.js' does not have an export named 'default'. Did you mean 'html'?
1 | (function (entry, fetcher)
    ^
SyntaxError: module '/home/sacs/Documents/dev/node_modules/@elysiajs/html/dist/index.js' does not have an export named 'default'. Did you mean 'html'?

Have a look to my last replies brother.

sacsbrainz commented 1 month ago

I can confirm version ^1.0.2 works fine

arthurfiorette commented 1 month ago

Hi guys, kita's v4.2.1 just fixed this issue. Sorry for the delay!

ref: https://github.com/kitajs/html/issues/261

indrazm commented 1 month ago

Hi guys, kita's v4.2.1 just fixed this issue. Sorry for the delay!

ref: kitajs/html#261

You rock!!

8549 commented 1 month ago

I upgraded my dependencies and can confirm @kitajs/html is version 4.2.1 but the error is still present. Is there something else I need to do or the @elysiajs/html plugin needs to be updated as well?

x4132 commented 1 month ago

clear your lock file (bun.lockb) and try again maybe

On Sun, Aug 4, 2024 at 7:54 AM 8549 @.***> wrote:

I upgraded my dependencies and can confirm @kitajs/html is version 4.2.1 but the error is still present. Is there something else I need to do or the @elysiajs/html plugin needs to be updated as well?

— Reply to this email directly, view it on GitHub https://github.com/elysiajs/elysia-html/issues/91#issuecomment-2267571005, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRBWFMRU47ZENZJGAPO5QLZPY6EFAVCNFSM6AAAAABLM3C56KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGU3TCMBQGU . You are receiving this because you commented.Message ID: @.***>

Jonatthu commented 3 weeks ago

Did not work even overriding the version or deleting the bun.lockb