Skip to content

Fix Turbopack dev on Next 14 by correcting client/server boundaries#205

Open
imApoorva36 wants to merge 1 commit intojson-schema-org:mainfrom
imApoorva36:fix/turbopack-setup-and-hydration
Open

Fix Turbopack dev on Next 14 by correcting client/server boundaries#205
imApoorva36 wants to merge 1 commit intojson-schema-org:mainfrom
imApoorva36:fix/turbopack-setup-and-hydration

Conversation

@imApoorva36
Copy link

What kind of change does this PR introduce?

Bugfix / Refactor

Issue Number:

Screenshots/videos:

N/A, it is an internal build / dev tooling fix.

If relevant, did you update the documentation?

Not required. Dev workflow remains unchanged except for the new optional dev:turbo command.


Summary

This PR fixes the turbopack dev issues on Next.js 14 by correcting invalid server/client boundaries and eliminating Webpack–Turbopack conflicts.

Root cause of the crashes and hydration errors:

  • Client-only libraries (@chakra-ui/react, @emotion/*) were imported inside Server Components.
  • Webpack-only compiler features were still enabled while running next dev --turbo.

This PR:

  • Moves Chakra’s ColorModeScript behind a proper client-only boundary.
  • Removes Chakra usage from Server Components (layout, MDX renderer, 404 page).
  • Replaces Chakra MDX primitives with semantic HTML equivalents.
  • Disables Webpack-only compiler features when running with Turbopack.
  • Adds a dev:turbo script for convenience.
  • Preserves existing behavior for the normal next dev flow.

After this change, next dev --turbo runs cleanly on Next 14 without hydration errors, loader crashes, or dependency upgrades.


Does this PR introduce a breaking change?

No.

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.

Setup turbopack for development

1 participant

Comments