SDK-613: upgrade Next.js examples to 16.3.4 and add example test coverage - #135
Open
devtools-agent[bot] wants to merge 5 commits into
Open
SDK-613: upgrade Next.js examples to 16.3.4 and add example test coverage#135devtools-agent[bot] wants to merge 5 commits into
devtools-agent[bot] wants to merge 5 commits into
Conversation
The two Next.js examples were pinned to next@14.2.15, which is what the Dependabot alert on this repo flags. Move both to next@15.5.25 (latest fully-patched 15.x); `npm audit` no longer reports any advisory against Next.js itself in either example. 15.x rather than 16.x: Next 16 requires node ^20.9 || >=22, which would break the node 18 and node 21 legs of the CI matrix, and it removes `next lint`, which both examples still use. Alongside the bump: - react/react-dom and their types move to 19, matching what Next 15's App Router expects; @rollbar/react already declares 19.x support. - Add `outputFileTracingRoot` to both next configs so Next 15 stops inferring the repo root as the workspace root (multiple lockfiles). - Add `target: ES2017` to the app-router tsconfig, as Next 15 requires for top-level await. Test coverage for the upgrade — both examples now run jest via `next/jest`, so the suites exercise the real SWC/Next transform: - pages router: `_app` renders the page with a Rollbar instance in context, and a throwing page renders the ErrorBoundary fallback and reports through `rollbar.critical` with the configured message, extra and callback; the home page renders (covers next/font/local and next/image under Next 15). - app router: the async `RootLayout` server component wraps the document in the Rollbar Provider, `next_error_handler/error.tsx` reports the error via `useRollbar` and resets, and the `ErrorBoundary` page renders. Wired up as `npm run test:examples` (skips examples without a `test:ci` script) and run as a new CI step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Follow-up to the 15.5.25 bump: go all the way to the current Next.js major. `npm audit` in both examples now reports nothing against `next` at all (the transitive `postcss` advisories 15.x carried are gone too). Next 16 requires node >= 20.9, so the node 18 leg of the CI matrix is removed; node 22 is added so the matrix still covers three versions. Next 16 also removes `next lint`, and `eslint-config-next@16` is flat-config only and needs ESLint >= 9. So both examples: - replace `.eslintrc.json` with `eslint.config.mjs` re-exporting `eslint-config-next/core-web-vitals` (which already carries the TypeScript setup and the .next/out/build ignores), - move eslint 8 -> 9, and - change their `lint` script from `next lint` to `eslint .`. ESLint is pinned to ^9 rather than ^10 deliberately: eslint-config-next 16 pulls eslint-plugin-react, eslint-plugin-import and eslint-plugin-jsx-a11y, none of which declare ESLint 10 support yet, so ^10 only installs behind three ERESOLVE peer overrides. The root `lint:examples` script still works unchanged -- ESLint 9 still accepts `--ext` -- and both examples lint clean via either invocation. tsconfig `jsx` moves from `preserve` to `react-jsx`, which Next 16 mandates, and the app-router example picks up the `.next/dev/types` include. Verified: both examples build (Turbopack), lint clean, and all six example tests added for this upgrade still pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The `Install` step (`npm run install:all -- ci`) failed on all three CI
legs:
npm error `npm ci` can only install packages when your package.json
and package-lock.json ... are in sync.
npm error Invalid: lock file's @rollbar/react@1.0.0+7da6e313 does
not satisfy @rollbar/react@1.0.0+d49a5d31
The two lockfiles regenerated for the Next 16 bump recorded
`@rollbar/react` as a *copied* dependency:
"node_modules/@rollbar/react": {
"version": "1.0.0+7da6e313",
"resolved": "file:.yalc/@rollbar/react", ...
That happens under npm 9, whose default for `install-links` is `true`
(npm 10 reverted it to `false`). In copy mode npm pins the version of
the `file:` dependency -- and `install-all.js` publishes the package
with `yalc publish --sig`, so that version carries a build signature
that differs on every machine. Any such lockfile can only ever be
installed on the box that generated it.
Regenerated both with npm 10 / `install-links=false`, which restores
the link form the other examples and `main` already use:
"node_modules/@rollbar/react": {
"resolved": ".yalc/@rollbar/react",
"link": true
The signature now only appears on the `.yalc/@rollbar/react` entry,
which `npm ci` does not verify -- confirmed by rewriting the local
signature to a bogus value and re-running `npm ci`, which succeeds
(main's lockfiles have carried a stale `0.12.0-beta+5817c339` there for
several releases for the same reason).
No dependency versions change. Verified after reinstalling both
examples in link mode: `npm ci`, `eslint .`, `next build` and all six
example tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ions
The new node 22 CI leg failed at the library build:
> rollup --config
[!] SyntaxError: Unexpected identifier 'assert'
`rollup.config.mjs` read the version/entry paths from package.json via
`import pkg from './package.json' assert { type: 'json' }`. Node 22
removed the `assert` import-attribute syntax (V8 kept only `with`), so
the config no longer parses there. Nothing in the library itself is
affected -- only this build config, and only on node >= 22.
Switched to `createRequire(import.meta.url)('./package.json')` rather
than `with { type: 'json' }`: `with` only exists from node 20.10 (and
18.20) on, whereas `createRequire` parses and runs on every version,
so nobody's local node breaks either way.
Verified by running the full CI sequence locally on node 22.23.2 with
npm 10.9.9 -- the exact pair the failing leg uses: `install:all -- ci`,
`lint`, `lint:examples`, `build:all` (all four examples) and both test
suites pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
brianr
reviewed
Sep 10, 2026
brianr
left a comment
Member
There was a problem hiding this comment.
Two CI concerns to address before merging:
Addresses both review comments on the CI workflow. `continue-on-error: true` sat on the `build` job, so every matrix leg could fail while the run still reported success -- the reason the `npm ci` breakage in this branch showed up as a green run. Removed it, so a regression in `Lint`, `Build`, `Test` or the new `Test examples` step now fails CI. `strategy.fail-fast: false` takes its place, which is what the original setting was presumably reaching for: every runtime still reports instead of being cancelled by the first failure. Node 21 has been end-of-life since June 2024, so that slot becomes node 24 (paired with npm 11, the version it bundles). The matrix is now node 20 -- the floor Next.js 16 supports, and what the examples pin -- plus the two maintained LTS lines, 22 and 24. Verified: the full CI sequence (`install:all -- ci`, `lint`, `lint:examples`, `build:all` across all four examples, `test`, `test:examples`) passes locally on node 24.21.0 with npm 11, as it already does on 22.23.2 with npm 10. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
brianr
self-requested a review
September 10, 2026 20:40
brianr
approved these changes
Sep 10, 2026
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.
SDK-613 — upgrade the Next.js examples off the vulnerable
next@14.2.15Both Next.js examples (
examples/nextjs, pages router, andexamples/nextjs-approuter, app router) were pinned tonext@14.2.15, which is what the Dependabot alert on this repo flags. This moves both tonext@16.3.4, the current major.npm auditin both examples now reports nothing againstnext— and the transitivepostcssadvisories that 15.x still carried are gone too.Framework / runtime moves
react,react-domand their@typesmove to 19, which is what Next 15+ App Router expects.@rollbar/reactalready declares 19.x support in its peer range, so no library change is needed.node: 18leg of the CI matrix is removed andnode: 22added, keeping three versions covered.outputFileTracingRootadded to both next configs so Next stops inferring the repo root as the workspace root (this repo has multiple lockfiles).jsxmovespreserve→react-jsx(mandated by Next 16); the app-router example also picks up the.next/dev/typesinclude andtarget: ES2017for top-level await.Lint plumbing
Next 16 removes
next lint, andeslint-config-next@16is flat-config-only and needs ESLint >= 9. So in both examples:.eslintrc.json→eslint.config.mjsre-exportingeslint-config-next/core-web-vitals(which already carries the TypeScript setup and the.next/out/buildignores),^8→^9,lintscript becomeseslint ..ESLint is pinned to
^9rather than^10deliberately:eslint-config-next@16pullseslint-plugin-react,eslint-plugin-importandeslint-plugin-jsx-a11y, none of which declare ESLint 10 support yet, so^10only installs behind threeERESOLVEpeer overrides. The rootlint:examplesscript keeps working unchanged — ESLint 9 still accepts--ext— and both examples lint clean via either invocation.Test coverage for the upgrade
An examples bump with no assertions is easy to get subtly wrong, so both examples now run jest through
next/jest, meaning the suites exercise the real SWC/Next transform rather than a hand-rolled babel config:_apprenders the page with a Rollbar instance in context; a throwing page renders theErrorBoundaryfallback and reports throughrollbar.criticalwith the configured message, extra and callback; the home page renders (which coversnext/font/localandnext/imageunder the new major).RootLayoutserver component wraps the document in the RollbarProvider;next_error_handler/error.tsxreports viauseRollbarand resets; theErrorBoundarypage renders.Wired up as
npm run test:examplesat the root (reusing the existingscripts/foreach-example.ts, skipping examples with notest:ciscript) plus atest:all, and run as a new Test examples step in CI.Verification
Both examples build (Turbopack), lint clean, and all six new example tests pass. Library source is untouched — this PR only moves the examples and CI.
🤖 Generated with Claude Code