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

Bug: Elysia 1.1.0 KitaJS HTML Issue #91

Open
indrazm opened this issue Jul 24, 2024 · 13 comments
Open

Bug: Elysia 1.1.0 KitaJS HTML Issue #91

indrazm opened this issue Jul 24, 2024 · 13 comments

Comments

@indrazm
Copy link

indrazm commented Jul 24, 2024

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
Copy link
Author

indrazm commented Jul 25, 2024

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
Copy link

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
Copy link
Author

indrazm commented Jul 25, 2024

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
Copy link

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
Copy link

x4132 commented Jul 27, 2024

kitajs/html@6790818

This looks like the offending commit.

x4132 added a commit to x4132/elysia-html that referenced this issue Jul 27, 2024
Manually create the Html Object since kita removed it for some reason.
@indrazm
Copy link
Author

indrazm commented Jul 30, 2024

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
Copy link
Author

indrazm commented Jul 30, 2024

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
Copy link

I can confirm version ^1.0.2 works fine

@arthurfiorette
Copy link
Contributor

arthurfiorette commented Aug 4, 2024

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

ref: kitajs/html#261

@indrazm
Copy link
Author

indrazm commented Aug 4, 2024

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

ref: kitajs/html#261

You rock!!

@indrazm indrazm closed this as completed Aug 4, 2024
@8549
Copy link

8549 commented Aug 4, 2024

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?

@indrazm indrazm reopened this Aug 4, 2024
@x4132
Copy link

x4132 commented Aug 4, 2024 via email

@Jonatthu
Copy link

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

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

No branches or pull requests

6 participants