Skip to content

Fix the Vercel build: create the Express app in app.js - #5

Merged
renderghost merged 2 commits into
mainfrom
fix/vercel-entrypoint
Oct 25, 2026
Merged

renderghost merged 2 commits into
mainfrom
fix/vercel-entrypoint

Conversation

@renderghost

Copy link
Copy Markdown
Owner

Problem

Both production deployments of `main` after #3, and the preview for #4, failed with:

Error: [BUILD_FAILED] No entrypoint found which imports express. Found possible entrypoint: app.js

Vercel scans the entry file itself for an Express import. `app.js` only imported `./src/site.js`, and Express was created two files deeper.

Fix

`app.js` now imports Express, creates the app and hands it to `createSite({ app })`. Nothing else changes: it is still exported for Vercel, and still listens on a port when run anywhere else.

Testing

  • 103 tests and the syntax check pass.
  • Imported `app.js` with `VERCEL=1` (demo data): it exports the app, serves the API and sets the CDN cache header. Run normally, it listens and `/healthz` is `ok`.
  • Not yet verified on Vercel itself. This PR's preview deployment is the check.

🤖 Generated with Claude Code

The first real Vercel builds failed with "No entrypoint found which imports
express. Found possible entrypoint: app.js": Vercel scans the entry file
itself for an Express import, and ours created the app in src/.

app.js now imports Express, creates the app and passes it to createSite().
Nothing else changes: it is still exported for Vercel, and still listens
on a port when run anywhere else.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
selections Ready Ready Preview Oct 25, 2026 4:42pm UTC

The first working Vercel preview served the API but returned 500 for the
page: "Cannot find module 'ejs'". Express loads its view engine by name at
runtime, which Vercel's file tracer can't follow, so EJS was left out of
the deployed function. Importing it and registering it with app.engine()
makes the dependency visible.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@renderghost
renderghost merged commit 9893c0f into main Oct 25, 2026
4 checks passed
@renderghost
renderghost deleted the fix/vercel-entrypoint branch October 26, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant