Closed tin-pham closed 1 month ago
Can you read the error message? Have you EVER read the documantaion? You haven't configured transformation. Therefore, the code causes error. So you have three choices.
typia generate
manually (https://github.com/honojs/middleware/blob/e488b9f08acf6cdb756114831d7aa5e7da3fc8f7/packages/typia-validator/package.json#L12 or you can see this Japanese article https://zenn.dev/daichi2mori/articles/20240422-hono-validation-demo#typia)typia generate
for custom command in wrangler.toml
(see https://developers.cloudflare.com/workers/wrangler/custom-builds/)vite
with unplugin-typia (see https://github.com/ryoppippi/unplugin-typia/blob/1010c892e6c4f2f43ee331c0fcff72d8efe374a4/examples/vite-hono)Thanks, i got it to work with the second choice, sorry for you inconvenient
No worries! Cheers
Question
Hono have a page where it can use with typia, but I can't seem make this to work. https://github.com/honojs/middleware/tree/main/packages/typia-validator
Here is how I did it 1) Setup a normal hono app using the Getting Started: https://hono.dev/docs/getting-started/basic 2) Install typia
3) Add some typia validation code according to hono doc: https://github.com/honojs/middleware/tree/main/packages/typia-validator 3) Run
npx typia setup
4) Runnpm run dev
(It will runwrangler dev
)Here is my full code:
It will cause this error
I try to search everywhere but it can't seem to work The closest discussion is this: https://github.com/samchon/typia/issues/812, but nothing relate to my problem.