Hello there,
I’m currently developing a API service using ElysiaJS. But I’m having trouble to get my code run on Vercel. Here’s what I’ve tried:
- By following ElysiaJS’s official guide, which setup bundler to bundle whole code, then output to another folder. This config leads to this:
In this case, I’ve setup build step and configured an output folder todistorapi. 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’sbuildscript
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
apito my git repository. Build command and build output folder is not configured.
This time the function actually work and triggers by going to/api.
TL;DR, problem I’ve encountered:
- Vercel does not treat
.jsor.tsfile as function if I manually set either build output folder OR build command. - If build command does not output build with Build Output API to output the bundle, I assumes, none of the file will be treated as function.
The code is on GitLab (api subfolder): apps/api · main · Wolf Yuan / Where is my YouBike · GitLab


