Skip to content

fix(dev): run the dev app under Turbopack again - #55

Merged
bvdaakster merged 1 commit into
mainfrom
fix/dev-turbopack
Nov 28, 2026
Merged

bvdaakster merged 1 commit into
mainfrom
fix/dev-turbopack

Conversation

@bvdaakster

Copy link
Copy Markdown
Contributor

pnpm dev ran Next with --webpack because Turbopack could not resolve the plugin source's ./x.js import specifiers to their .ts files (admin and API answered 500).

Cause

Turbopack does apply TypeScript's extension rewriting, but only when the app's tsconfig uses node16/nodenext module resolution. dev/tsconfig.json set moduleResolution: bundler.

Change (dev app only; nothing under src/)

  • dev/tsconfig.json: module and moduleResolution are NodeNext.
  • Dev files import with explicit extensions, as NodeNext requires (./seed.js, ./helpers/credentials.js, next/link.js). next/link is CommonJS, so the home page picks the component off the default import the way Payload's own packages do.
  • package.json: the dev script drops --webpack. The webpack extensionAlias in dev/next.config.mjs stays for anyone running next dev dev --webpack.

Checked locally

  • next dev dev (Turbopack): /admin, /admin/login, /admin/collections/notifications, /, /demo and /api/users/me answer 200, no resolve errors in the log.
  • next dev dev --webpack: /admin and / answer 200.
  • pnpm lint (0 errors), tsc --noEmit, tsc --noEmit -p dev/tsconfig.json, pnpm test:int (133 passed).

Not checked: next build dev and the Playwright suite.

🤖 Generated with Claude Code

https://claude.ai/code/session_0122PV8TJ7ELGdAX7H2hdrRU

Turbopack only resolves a TypeScript file's `./x.js` specifiers to
`.ts` when the app's tsconfig uses node16/nodenext module resolution;
dev/tsconfig.json used "bundler", so the plugin source could not be
resolved and the dev script fell back to --webpack.

dev/tsconfig.json now uses NodeNext, the dev files import with explicit
extensions, and the dev script uses Next's default bundler.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122PV8TJ7ELGdAX7H2hdrRU
@claude

claude Bot commented Nov 28, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@bvdaakster
bvdaakster merged commit 3566e0b into main Nov 28, 2026
6 checks passed
@bvdaakster
bvdaakster deleted the fix/dev-turbopack branch November 28, 2026 15:02
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.

1 participant