-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Deploying to Vercel Serverless Functions #1256
Comments
Hi @PodTT Have you tried it? |
@yusukebe Trying this out as well. The |
I'm seeing this as well when using I suspect it may be related to this: https://github.com/orgs/vercel/discussions/1426 |
Update, it turns out you need to add |
I'm still having trouble. I'll get a 500 response on any |
I couldn't get any of the examples in the docs working in vercel. Only locally. Guessing they haven't been updated. |
hi folks, we are interested in this as well. is this bug going to be fixed ? also - we deploy using |
I would like to investigate but I am busy cleaning up other Issues, I think it may be a Vercel issue but I am not sure. I will investigate when I get some time. |
This is an Hono server deployed to Vercel: https://github.com/hwy-js/hwy/tree/0f9d7f662984267e24e15a22c960425bcbdb92e2/docs This does not use the Vercel CLI, so maybe that's where the issues are cropping up for others. Anyway, maybe this example can help someone. There aren't POSTs in this example, but works fine if you add them (both locally and when deployed). The tricks are:
|
Hi ,
Could you elaborate on your deployment please - do u use "vercel build &&
vercel deploy --prebuilt" for the deployment. I checked the package.json,
but couldn't figure how the deployment to vercel was happening.
Also could u clarify the role of api/main js for a full blown hono
application? Would that file just contain the router? I'm just trying to
figure out a realistic application with many endpoints, etc.
…On Thu, Sep 28, 2023, 04:06 Sam Cook ***@***.***> wrote:
I'm still having trouble. I'll get a 500 response on any post method when
adding a JSON payload (locally). It would be nice to see a complete working
example somewhere
This is an Hono server deployed to Vercel:
https://github.com/hwy-js/hwy/tree/0f9d7f662984267e24e15a22c960425bcbdb92e2/docs
This does *not* use the Vercel CLI, so maybe that's where the issues are
cropping up for others. Anyway, maybe this example can help someone. There
aren't POSTs in this example, but works fine if you add them (both locally
and when deployed).
The tricks are:
1. Set NODEJS_HELPERS=0 in your Vercel production environment
variables. POST requests break if you don't do this!
2. Your function needs to be in an API folder, e.g., ~/API/main.js.
3. Adjust vercel.json to point to your server entry file.
—
Reply to this email directly, view it on GitHub
<#1256 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASYUZNTM6C2DMSYCDVFETX4SS7VANCNFSM6AAAAAA2UCI5PE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is there any official way of deploying a hono app to Vercel serverless functions? I am not talking about edge. I am using prisma with Hono and it would be nice to deploy to serverless functions. As far as I know Prisma is not supported on edge runtimes, it seems like Vercel serverless functions are my only option. I could not find documentation on the website relating to this topic.
The text was updated successfully, but these errors were encountered: