Skip to content

fix: untrack next-env.d.ts and generate via next typegen#18239

Merged
wackerow merged 2 commits into
devfrom
fix/untrack-next-env
May 21, 2026
Merged

fix: untrack next-env.d.ts and generate via next typegen#18239
wackerow merged 2 commits into
devfrom
fix/untrack-next-env

Conversation

@pettinarip
Copy link
Copy Markdown
Member

next-env.d.ts has shown up dirty after every dev/build since #18139. Next 16 writes a different path in dev vs build (.next/dev/types/... vs .next/types/...vercel/next.js#85738), so no committed version is stable. Official guidance is to gitignore it.

  • Re-add next-env.d.ts to .gitignore (reverts that piece of ci: consolidate workflows into ci.yml #18139).
  • pnpm type-checknext typegen && tsc --noEmit. next typegen (Next 15.5+) regenerates the file in ~600ms with no full build.

next-env.d.ts is auto-generated by Next.js and the official recommendation
is to keep it out of source control. Since Next 16, dev and build use
different distDirs (.next/dev vs .next), so the file's content diverges
between modes — making a stable committed version impossible.

Revert versioning the file (#18139) and have `pnpm type-check` invoke
`next typegen` to generate it on demand. typegen ships in Next 15.5+
and runs in ~600ms without a full build, producing the canonical
build-mode types in .next/types/.

Refs:
  https://nextjs.org/docs/app/api-reference/config/typescript
  vercel/next.js#85738
@pettinarip pettinarip requested a review from wackerow as a code owner May 20, 2026 15:55
@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 81f6870
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6a0eb8b039896100098b5874
😎 Deploy Preview https://deploy-preview-18239.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 69 (🟢 up 5 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (🟢 up 1 from production)
SEO: 98 (🔴 down 1 from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the dependencies 📦 Changes related to project dependencies label May 20, 2026
Avoids "cannot find module" errors until the `next-env.d.ts` file is generated by a fresh clone running `npx tsc --noEmit`
Copy link
Copy Markdown
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

Thanks @pettinarip, looks good! Just added a commit updating one skill and the agents documentation to point to use of pnpm type-check over npx tsx --noEmit to avoid errors on fresh clones/worktrees.

@wackerow wackerow merged commit 36ff847 into dev May 21, 2026
14 of 15 checks passed
@wackerow wackerow deleted the fix/untrack-next-env branch May 21, 2026 07:49
@claude claude Bot mentioned this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies 📦 Changes related to project dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants