Shaun
Failed deploy with Hono, Vite and email event handler
I'm building a email disposable service with Cloudflare workers. When I deploy using
vite build --mode client && vite build && wrangler deploy --no-bundle
I get the error: A request to the Cloudflare API (/accounts/xxx/workers/scripts/disposible-email/versions) failed. Uncaught TypeError: Cannot read properties of undefined (reading 'map') at null.<anonymous> (index.js:1:21247) in route [code: 10021]
.
I already figured out that the problem lies with export default { fetch: app.fetch, email: async (message, env) => {}
because when I export app
like export default app
the error does not occur. When I use export default { fetch: app.fetch }
the error will occur.
My entrypoint (index.tsx
) looks like this:
I used https://fiberplane.com/blog/client-side-guide/ to setup the project.33 replies