docs: server-only/client-only in Next.js - #80408
Merged
Merged
Conversation
icyJoseph
commented
Jun 11, 2025
icyJoseph
commented
Jun 11, 2025
lubieowoce
approved these changes
Jun 11, 2025
delbaoliveira
approved these changes
Jun 11, 2025
| > **Good to know**: The corresponding [`client-only` package](https://www.npmjs.com/package/client-only) can be used to mark modules that contain client-only logic like code that accesses the `window` object. | ||
| The corresponding [`client-only` package](https://www.npmjs.com/package/client-only) can be used to mark modules that contain client-only logic like code that accesses the `window` object. | ||
|
|
||
| In Next.js, installing `server-only` or `client-only` is **optional**. However, if your linting rules flag extraneous dependencies, you may install them to avoid issues. |
Contributor
There was a problem hiding this comment.
Unused?
Suggested change
| In Next.js, installing `server-only` or `client-only` is **optional**. However, if your linting rules flag extraneous dependencies, you may install them to avoid issues. | |
| In Next.js, installing `server-only` or `client-only` is **optional**. However, if your linting rules flag unused dependencies, you may install them to avoid warnings. |
Member
Author
There was a problem hiding this comment.
Not really, this was more about covering base for importing a dependency that's not defined in your package.json, for example:
schoenwaldnils
added a commit
to schoenwaldnils/next.js
that referenced
this pull request
Jun 16, 2025
…aldnils/next.js into fix/experimental-https-metaimage * 'fix/experimental-https-metaimage' of github.com:schoenwaldnils/next.js: (74 commits) [dev-overlay] Move code into new top-level folder in src/next-devtools (vercel#80281) Docs: Polish Getting Started section (vercel#80402) Fix a couple typos (vercel#80080) feat(turbopack): Add simple tree shaker (vercel#78286) docs: server-only/client-only in Next.js (vercel#80408) v15.4.0-canary.78 Add response handling inside handlers (vercel#80189) Docs: Getting Started feedback (vercel#80401) [test] unflake turbopack dev navigation test case (vercel#80407) Use new `browserWithResponse()` method in `empty-fallback-shells` tests (vercel#80406) Update Turbopack development test manifest (vercel#80399) Update Rspack development test manifest (vercel#80397) Update Rspack production test manifest (vercel#80398) Update Turbopack production test manifest (vercel#80400) Require that `turbo_tasks::value_trait` items be annotated with `turbo-tasks::function` (vercel#79178) Docs: Clarify how intercepting routes work and update example (vercel#80145) build(turbopack): Update `swc_core` to `v27.0.1` (vercel#80338) v15.4.0-canary.77 Turbopack: include obsolete entries in computation (vercel#80362) fix(next-swc-wasm): Only enable turbo-rcstr's napi feature when building the next-swc-napi crate/package (vercel#80390) ...
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes: https://linear.app/vercel/issue/DOC-4679/server-only-client-only-as-managed-by-nextjs
Fixes: #71071