We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I developed an application that uses the html helper from Hono. The original code is the following one (before bundling it with esbuild):
html
esbuild
import { Hono } from 'hono' import { html } from 'hono/html' const app = new Hono() app.get('/:username', (c) => { const { username } = c.req.param() return c.html( html`<!DOCTYPE html> <h1>Hello! ${username}!</h1>` ); }) export default app;
Wasm Workers Server returns an "error running the function" message.
Create a new folder
Create an index.js file with the content above
index.js
Bundle it with esbuild:
npx esbuild index.js --format=esm --bundle --outfile=dist/[...app].js
Run the current main branch of the project and pass the dist folder as an argument:
main
dist
cargo run -- ../PATH_TO_HONO_PROJECT_FOLDER/dist
Try to access http://localhost:8080/hi
The following application returns a correct HTML code instead of an error.
No response
The text was updated successfully, but these errors were encountered:
The error comes from the Response type in the JS kit shims. Currently, we store the body parameter as it is regardless of the type. We assumed this variable would be always a string. However, Hono is returning an String object, which is slightly different than string primitives.
Response
body
string
String
Sorry, something went wrong.
Angelmmiguel
Successfully merging a pull request may close this issue.
Describe the bug
I developed an application that uses the
html
helper from Hono. The original code is the following one (before bundling it withesbuild
):Wasm Workers Server returns an "error running the function" message.
Reproduction steps
Create a new folder
Create an
index.js
file with the content aboveBundle it with esbuild:
Run the current
main
branch of the project and pass thedist
folder as an argument:Try to access http://localhost:8080/hi
Expected behavior
The following application returns a correct HTML code instead of an error.
Additional context
No response
The text was updated successfully, but these errors were encountered: