Repository navigation
Fix the Vercel build: create the Express app in app.js - #5
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Both production deployments of `main` after #3, and the preview for #4, failed with:
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
🤖 Generated with Claude Code