Skip to content

fix(next): avoid package.json resolver failures in loader dep tracking#1192

Merged
VaguelySerious merged 4 commits intovercel:mainfrom
NathanColosimo:fix/next-loader-packagejson-resolve
Feb 26, 2026
Merged

fix(next): avoid package.json resolver failures in loader dep tracking#1192
VaguelySerious merged 4 commits intovercel:mainfrom
NathanColosimo:fix/next-loader-packagejson-resolve

Conversation

@NathanColosimo
Copy link
Copy Markdown
Contributor

Fixes #1087 , and I've been having this problem myself with: Bun monorepo, turbopack, nextjs, calling start() in react server action in the actions.ts file.

In monorepo + Turbopack setups, loader dependency tracking can fail with:

  • TurbopackInternalError: failed to deserialize message
  • nested ResolveMessage: Cannot find module '../package.json'

This comes from resolving package.json via createRequire(...).resolve(...) inside resolveLoaderStaticDependencies().

Fix:

  • Stop resolving package.json through createRequire(...).resolve(...)
  • Derive package.json paths from already-resolved paths
  • Add them only if they actually exist.

lmk any changes!

@NathanColosimo NathanColosimo requested review from a team and ijjk as code owners February 25, 2026 19:45
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 25, 2026

🦋 Changeset detected

Latest commit: e49606b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@workflow/next Patch
workflow Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/nitro Patch
@workflow/web-shared Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 25, 2026

@NathanColosimo is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

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

Hi, this change makes sense to me

Could you sign off this commit with steps mentioned here https://github.com/vercel/workflow/pull/1192/checks?check_run_id=64907677338

I, nathancolosimo <nathancolosimo@gmail.com>, hereby add my Signed-off-by to this commit: 7a7e02d

Signed-off-by: nathancolosimo <nathancolosimo@gmail.com>
@NathanColosimo
Copy link
Copy Markdown
Contributor Author

Hi, this change makes sense to me

Could you sign off this commit with steps mentioned here https://github.com/vercel/workflow/pull/1192/checks?check_run_id=64907677338

fixed, ty

@NathanColosimo NathanColosimo requested a review from ijjk February 26, 2026 16:42
@VaguelySerious
Copy link
Copy Markdown
Member

@NathanColosimo Could you also add a changset? (pnpm changeset) with a patch version change for @workflow/next?

@VaguelySerious VaguelySerious merged commit 339c343 into vercel:main Feb 26, 2026
67 of 101 checks passed
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.

Bug fix: Monorepo build Error [TurbopackInternalError]: failed to deserialize message

3 participants