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