Skip to content

chore(docs): document additional way to manually install Next.js Runtime #1813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ by targeting the `/_next/image/*` route:

## Disabling included image loader

If you wish to disable the use of the image loader which is bundled into the runtime by default, set the `DISABLE_IPX` environment variable to `true`.
If you wish to disable the use of the image loader which is bundled into the runtime by default, set the `DISABLE_IPX` environment variable to `true`.

This should only be done if the site is not using `next/image` or is using a different loader (such as Cloudinary or Imgix).

Expand All @@ -60,7 +60,7 @@ For more details on Next.js Middleware with Netlify, see the [middleware docs](h

### Limitations

Due to how the site configuration is handled when it's run using Netlify Edge Functions, data such as `locale` and `defaultLocale` will be missing on the `req.nextUrl` object when running `netlify dev`.
Due to how the site configuration is handled when it's run using Netlify Edge Functions, data such as `locale` and `defaultLocale` will be missing on the `req.nextUrl` object when running `netlify dev`.

However, this data is available on `req.nextUrl` in a production environment.

Expand Down Expand Up @@ -107,7 +107,15 @@ Edge runtime or middleware is enabled it will also generate edge functions for m

## Manually installing the Next.js Runtime

The Next.js Runtime installs automatically for new Next.js sites on Netlify. You can also install it manually like this:
The Next.js Runtime installs automatically for new Next.js sites on Netlify. You can also install it manually in the
following ways:

### From the UI (Recommended):

You can go to the [UI](https://app.netlify.com/plugins/@netlify/plugin-nextjs/install) and choose the site to install the Next.js Runtime on. This method
is recommended because you will benefit from auto-upgrades to important fixes and feature updates.

### From `npm`:

```shell
npm install -D @netlify/plugin-nextjs
Expand All @@ -117,9 +125,11 @@ npm install -D @netlify/plugin-nextjs

```toml
[[plugins]]
package = "@netlify/plugin-nextjs"
package = "@netlify/plugin-nextjs"
```

This method is recommended if you wish to pin the Next.js Runtime to a specific version.

## Manually upgrading from an older version of the Next.js Runtime

If you previously set these values, they're no longer needed and should be removed:
Expand All @@ -139,7 +149,7 @@ information on changes to how they are handled in this version. In particular, n
files must be placed in `public`, not in the root of the site.

## Using with pnpm
If your site uses pnpm to manage dependencies, currently you must [enable public hoisting](https://pnpm.io/npmrc#public-hoist-pattern).
If your site uses pnpm to manage dependencies, currently you must [enable public hoisting](https://pnpm.io/npmrc#public-hoist-pattern).
The simplest way to do this is to create a `.npmrc` file in the root of your project with the content:

```ini
Expand Down