In this case, I’ve setup build step and configured an output folder to dist or api. The output is being treated as static assets but not functions.
Use Vercel’s own build system. I removed every build command and output folder. Also package.json’s build script
Vercel’s build system now automatically identify how to build the project. Results this output structure:
Note that here Vercel now treated files as function. But Vercel it didn’t bundle it, which makes the function fail. Due to in my code, the main entrypoint references to another file in project.
I built it locally (running bundler on my end), then submit the bundled code inside folder named api to my git repository. Build command and build output folder is not configured.
Note that why I didn’t report this to ElysiaJS side is because I don’t think this only applies to it. I think this problem will occur on different framework as well.
Setup myself the build command → deployment failed
Default conf and no custom build command → deploy success but only one / function is deployed
On all test I made bun just crash with ResolveMessage {} 500 err. No meaningfull output logs during runtime I don’t know why it does not works.
Please help.
Can you try to manually bundling your code with bun build (Documentation here: Bundler - Bun) and deploy that file to Vercel?
In my case it will work because imports to other file is now inside the code rather than on external filesystem. The issue looks like Vercel bundler and deployment system acting weird.
Moving to a custom build command changes how Vercel treats your project. It essentially stops guessing and starts expecting you to follow the Build Output API format exactly.
When you let Vercel handle the build automatically, it might detect your files but fail to bundle their external dependencies. This is why you’re hitting runtime errors; the function is being deployed, but the supporting code it needs to actually run is missing.
To resolve this, you’ll need to configure your ElysiaJS bundler to output into the .vercel/output/ directory using this structure:
By bundling your function into a self-contained .func folder with its own .vc-config.json, you ensure Vercel has all the dependencies it needs right there in the deployment.