Files
vercel__workflow/.changeset/fix-next-version-resolution.md
Nathan Rajlich fe131105f2 fix(next): resolve next/package.json from working directory first (#1701)
* fix(next): resolve next/package.json from working directory first

In npm workspaces monorepos, `@workflow/next` can be hoisted to the root
`node_modules/` while `next` stays in a workspace's local `node_modules/`.
The eager `require('next/package.json')` on the fallback path resolved
relative to `@workflow/next`'s own location, failing before the correct
working-directory-relative resolution could run.

Restructure `resolveNextVersion()` to try the working directory path first,
fall back to the package-relative path second, and wrap both in separate
try/catch blocks so neither can crash the process.

Closes #1680

* fix(next): capture resolution errors and include workingDir in error message

Address review feedback: capture caught errors from both resolution
attempts and attach them via `cause` on the final thrown error. Include
the working directory in the error message to aid debugging in monorepo
and CI environments.
2026-04-13 17:35:00 +00:00

104 B

@workflow/next
@workflow/next
patch

Fix next/package.json resolution failure in npm workspaces monorepos