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

Runtime error after just importing the module #84

Open
mrctrifork opened this issue Mar 16, 2024 · 4 comments
Open

Runtime error after just importing the module #84

mrctrifork opened this issue Mar 16, 2024 · 4 comments

Comments

@mrctrifork
Copy link

mrctrifork commented Mar 16, 2024

Hi I've been through the setup phase of a basic server and when trying to add the html module it seems like it doesn't work.

Hello world program results in error after use(html())

TypeError: $.map is not a function. (In '$.map((X)=>{if(Z)X.$elysiaHookType="global";else X.$elysiaHookType=void 0;return X})', '$.map' is undefined)
@mrctrifork mrctrifork changed the title It doesn't work Runtime error after just importing the module Mar 16, 2024
@nyrdz
Copy link

nyrdz commented Mar 18, 2024

Looks like it's been fixed in 'main' branch. I got that same issue using the version available on npm.
To work with the plugin in the meantime until a new version with a fix is published on npm I did the following:

  1. Checked out the repo
  2. cd elysia-html; bun install && bun run build && bun link
  3. cd to_your_project; bun link @elysiajs/html --save

@mrctrifork
Copy link
Author

Thank you for the workaround and the headsup. I'll try this whenever I get the oportunity. In the meantime I have just installed react and rolled out my own SSR with bun. It was transparently easy.

@gagangulyani
Copy link

Looks like it's been fixed in 'main' branch. I got that same issue using the version available on npm. To work with the plugin in the meantime until a new version with a fix is published on npm I did the following:

  1. Checked out the repo
  2. cd elysia-html; bun install && bun run build && bun link
  3. cd to_your_project; bun link @elysiajs/html --save

I spent hours figuring out what I was doing wrong, then I found this one, helped me fix my issue! Thanks!

@toddheslin
Copy link

Everything was working fine for me on 0.8.0 so if you don't want to do the workaround you could just go:
bun add @elysiajs/[email protected]

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

4 participants