Skip to content

Replace Next.js with Vercel native serverless functions#109

Open
marcalexiei wants to merge 3 commits intochangesets:masterfrom
marcalexiei:serverless
Open

Replace Next.js with Vercel native serverless functions#109
marcalexiei wants to merge 3 commits intochangesets:masterfrom
marcalexiei:serverless

Conversation

@marcalexiei
Copy link
Copy Markdown
Contributor


next was only used to expose a single webhook endpoint.

This PR removes it entirely in favour of Vercel's zero-config api/ directory convention.

Important

I've read about here: https://vercel.com/docs/functions,
it sounds that they should be enough for the bot use case

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

@marcalexiei is attempting to deploy a commit to the Changesets Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

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

Project Deployment Actions Updated (UTC)
changesets-bot Ready Ready Preview, Comment May 5, 2026 8:37am

Request Review

@Andarist
Copy link
Copy Markdown
Member

Andarist commented May 5, 2026

Deployment fails with:

Warning: Could not identify Next.js version, ensure it is defined as a project dependency.
Error: No Next.js version detected. Make sure your package.json has "next" in either "dependencies" or "devDependencies". Also check your Root Directory setting matches the directory of your package.json file.

Comment thread vercel.json
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a vercel.json with a minimal configuration setting "framework": null.

This disables Vercel’s framework auto-detection, which was incorrectly identifying the project as Next.js after the migration to native serverless functions.

If the deployment still fails, check the Vercel dashboard → Project Settings → General → Framework Preset, and change it from “Next.js” to “Other”.

Note

I’m not very familiar with Vercel, so I used Claude to help identify potential causes for the log you shared.

@Andarist
Copy link
Copy Markdown
Member

Andarist commented May 5, 2026

Hitting curl https://changesets-1q76dtisl-changesets.vercel.app/api/webhook results with this in the deployment logs:

(node:4) Warning: Failed to load the ES module: /var/task/api/webhook.js. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4) Warning: Failed to load the ES module: /var/task/api/webhook.js. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension.
/var/task/api/webhook.js:1
import { createNodeMiddleware, createProbot } from "probot";
^^^^^^

Comment thread package.json
"homepage": "https://github.com/apps/changeset-bot",
"license": "MIT",
"repository": "https://github.com/changesets/bot",
"type": "module",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts files are compiled to ESM but we don't have "type": "module", so probably the runtime is threading them as CJS so they error once they execute the first import.
Let's see if now works!

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.

Update next.js

2 participants