Skip to content
Discussion options

You must be logged in to vote

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.

Next.js handles server-only and client-only imports internally to provide clearer error messages when a module is used in the wrong environment. The contents of these packages from NPM are not used by Next.js.

It is already automatically interpreted by the framework. Next.js does some additional checks to make sure you get better errors when a module ends up in the wrong module graph.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@icyJoseph
Comment options

@abhishekmardiya
Comment options

@icyJoseph
Comment options

Answer selected by icyJoseph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants