anand248
anand248
Explore posts from servers
HHono
Created by anand248 on 10/15/2024 in #help
Vite plugin does not compile the commonjs module
module is not defined at eval (/Users/sutikshandubey/invoice001/web-360/node_modules/@babel/runtime/helpers/typeof.js:12:1) at instantiateModule (file:///Users/sutikshandubey/invoice001/web-360/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:52961:11 Click outside, press Esc key, or fix the code to dismiss. You can also disable this overlay by setting server.hmr.overlay to false in vite.config.ts.
3 replies
HHono
Created by anand248 on 10/15/2024 in #help
Vite plugin does not compile the commonjs module
the library I am trying to use is jspdf
3 replies
HHono
Created by anand248 on 10/9/2024 in #help
honox - not returning anything from POST, gives 404.
If POST implementation does not return anything, then endpoint gives 404 error, which is misleading.
3 replies
HHono
Created by anand248 on 10/6/2024 in #help
Nested form objects POST
Server side code was
export const invoiceFormSchema = z.object({
invoiceHeader: invoiceSchema,
items: z.array(invoiceDetailsSchema),
});

export const POST = createRoute(zValidator("form", invoiceFormSchema), async (c) => {
const data = c.req.valid("form");
...
export const invoiceFormSchema = z.object({
invoiceHeader: invoiceSchema,
items: z.array(invoiceDetailsSchema),
});

export const POST = createRoute(zValidator("form", invoiceFormSchema), async (c) => {
const data = c.req.valid("form");
...
It was failing the zod validation saying no nested object present. I googled more and found that this is where the world abondons the HTML form post https://www.reddit.com/r/webdev/comments/ug13uc/how_can_i_make_post_request_with_nested_form_data/ I also went back to usual way of start sending body as application/json and start calling the server POST manually with fetch.
4 replies