Repository navigation
fix(tempo): mark the mppx/client import of gatewayActions optional for webpack - #5437
Merged
Merged
Conversation
…r webpack Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01D3nmWfJRVxySnhjuxJ7H7t
🦋 Changeset detectedLatest commit: 5f21760 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 8, 2026
Merged
This was referenced Nov 9, 2026
This branch had an error being deployed
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
viem/tempore-exportsgatewayActions, whoseload()holds a literalimport('mppx/client').mppxis an optional peer, sonpm i viemdoes not install it. Webpack builds every module that it does not skip throughsideEffects, and fails on the unresolved import. Next.js's webpack build fails even when the app imports only a constant:Plain webpack 5.112.2 fails the same way with
optimization.sideEffects: false. Next.js 15 and earlier build with webpack by default. Turbopack, Rolldown, and Vite build it.Change
load()wraps the import intry, and itscatchthrows the existingGateway.MppxNotInstalledError, whichpay()threw before. Webpack treats animport()insidetryas optional: a missing module becomes a warning, and the import rejects at runtime. The specifier stays literal, so each bundler still bundlesmppxwhen the app installs it. The runtime behavior ofgatewayActionsdoes not change.Alternatives considered:
/* webpackIgnore: true */hidesmppxfrom bundlers, so a browser app withmppxinstalled could no longer pay.gatewayActionschanges the API.Validation
With a packed build of this branch and no
mppx:next build --webpackCan't resolve 'mppx/client'warningaccounts(Tempo ID SDK),next build --webpackmppxinstalledmppxmppx(1.5 MB of lazy chunks against 8 KB without it)pnpm buildandpnpm checkpass. The Gateway tests did not run locally, since the test chain needs IPv6.gatewayActions > behavior: pays with the client accountcovers the load withmppxinstalled.No test fails without this change.
environments/nextresolves Viem'smppxpeer from the workspace root's dev dependency, so a webpack build there passes either way. A regression check needs a webpack build wheremppxis absent. Direction on where such a check belongs is welcome.Generated by Claude Code