system There's another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes. https://community.vercel.com/t/debugging-404-errors/437 A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.
Chrisrivero Dev Hey, This doesn’t sound like a 404 issue. If the function is hanging for about 60 seconds and then dying with INTERNAL_FUNCTION_INVOCATION_FAILED, I’d first try to confirm whether the function is actually entering your handler in Vercel. Can you add a log as the very first line of the function and see if that appears in the invocation logs? If it does, then I’d start checking what it’s waiting on after that, especially a database connection or anything environment-specific between local and Vercel. If the first log never appears, that points more toward the runtime/startup side rather than your application logic. Since the generated artifact works locally on Node 22/24, I’d definitely want to isolate exactly where execution stops in Vercel before changing more code.
Jacob Paris This is an initialization timeout, failing before your server receives its request. The most likely reason is if `server.listen()` never completes in a way that Vercel can see For zero-config Node servers, Vercel captures your server.listen() call while the module loads and routes traffic to it internally, ignoring the PORT you pass. This removes a layer of overhead by letting Vercel serve your server directly instead of receiving and passing into an internal service. Running the built server.mjs directly with Node skips that step, which is why it works locally. I think it's possible that passing the HOST to your listen call is preventing Vercel from connecting to it, but hard to say for certain without testing. You could try a deployment without that and see if it starts working. Otherwise, to find where your module stops during initialization, add console.log at the very top of your entry file and right before and after server.listen(), redeploy, and check Runtime Logs. If the first log never appears, the module isn't finishing loading. If it appears but the listen log doesn't, listen() isn't being reached during startup
Pauline P. Narvas Could you try the following? - Replace all path alias imports (`@/*`) with relative imports (`./` or `../`) - this is the most reliable fix - Use explicit file extensions in imports (`.ts`, `.tsx`) as Bun sometimes requires them Let us know how you get on!
Darkstar Hey, thanks for taking a look. Sorry for the delayed response. As I mentioned in my post, it will work fine if I remove the path alias and replace them all with relative imports. But I would like to know whether there is a way to get it to work with the path alias? Path alias is a very convinient thing. And I have used it a lot in the project I am trying to deploy. So going and replacing all those import calls with relative imports is a thing I would like to avoid if possible. Regarding your second option. It won’t work if the file extenions are `.ts` on Bun runtime. It will work if the file extension is `.js`. But for Bun it works even without the file extension as long as path alias is not used, so you don’t need to have any extension at all. As for the path alias making it break, is it a known limitation? Is it something planned to be fixed? Also, another question I have is, should I have some sort of build script? Since this is only a REST API built with Hono (no frontend code), I thought I will not need anything extra. Plus the official example doesn’t seem to have any build script either: https://github.com/vercel/examples/tree/main/framework-boilerplates/hono-bun I tried using the `bun build` command as a build script. So Vercel runs it when it runs `vercel build`. This way all my code gets bundled into one file in `/dist/app.js`, and there won’t be any path alias. And I get to keep the path alias in my source code. But this also breaks at runtime. It outputs the same error I have in my original post. I suspect in this case it’s because the build output is in `/dist/app.js` and Vercel doens’t find it? Because in the docs it says the only files that are supported are these:https://vercel.com/docs/frameworks/backend/hono#exporting-the-hono-application Because of that I tried ouputting the build output to a place like `/app.js`, but that didn’t work either. Same error. It’s bit hard to troubleshoot because build passes, and it only fails at runtime and I get the same error on all occasions. I am happy to share and clarify things further if something is not clear.
Darkstar I came across this: https://vercel.com/changelog/experimental-build-mode-hono-express The build mode that gets enabled by that environment variable seems to work fine with path alias. Both on Node and Bun. So basically, if you set that environment variable inside your Vercel project settings you can keep your path alias in the imports without any issues. I wonder whether it would be a good idea to link that changelog or document this behavior in a doc somewhere. Ideally here: https://vercel.com/docs/frameworks/backend/hono
Anshuman Bhardwaj Thanks @shige. I agree having sandbox in multiple regions will be so amazing! Passing on this feedback to our team.
Tadashi Shigeoka Thank you for the quick response, @anshumanb san! Looking forward to seeing multi-region support come to Vercel Sandbox.
Felix421 I would also like to second this request. I am with a cloud consulting firm in Germany and we would love to adopt vercel sandbox as our AI platform solution. We are as of now unfortunately unsure due to the lack of EU hosting. Do you already have distinct plans to expand sandboxes availability? Have a great day everyone! Best regards Felix
Jacob Paris How are you injecting the cookie? Can you add it in a request interceptor instead so it resolves at request time instead of ahead of time?
Bharathrnair7 1528 async function processQueue(newAccessToken?: string, error?: any) { while (requestQueue.length) { const queued = requestQueue.shift(); if (!queued) continue; if (error) { queued.reject(error); } else { try { // Explicitly set the new token on the queued request config // instead of relying on the interceptor (which reads stale cookies) if (newAccessToken) { queued.config.headers = { ...queued.config.headers, Authorization: \`Bearer ${newAccessToken}\`, }; } const response = await http(queued.config); queued.resolve(response); } catch (err) { queued.reject(err); } } } } try { const newAccessToken = await handleTokenRefresh(); // process all queued requests with the new token await processQueue(newAccessToken); // retry the original request with the new token explicitly originalRequest!.headers.Authorization = \`Bearer ${newAccessToken}\`; const retryResponse = await http(originalRequest!); response.data = retryResponse.data.Output; response.messages = \["Your request was processed successfully."\]; } finally { isRefreshing = false; } im injecting the cookies, in interceptor itself