Skip to content

Update middleware documentation for custom server#33535

Merged
kodiakhq[bot] merged 4 commits intovercel:canaryfrom
saevarb:patch-1
Jan 21, 2022
Merged

Update middleware documentation for custom server#33535
kodiakhq[bot] merged 4 commits intovercel:canaryfrom
saevarb:patch-1

Conversation

@saevarb
Copy link
Copy Markdown
Contributor

@saevarb saevarb commented Jan 21, 2022

Upgrading from 12.0.0 to 12.0.8 results in [dev] error - Error: To use middleware you must provide a hostnameandport to the Next.js Server and this requirement did not seem to be documented anywhere. Fixes #33450 which seems to have been erroneously closed.

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • Make sure the linting passes by running yarn lint

Upgrading from 12.0.0 to 12.0.8 results in `[dev] error - Error: To use middleware you must provide a `hostname` and `port` to the Next.js Server` and this requirement did not seem to be documented anywhere.
Comment thread docs/middleware.md Outdated
@styfle styfle requested a review from javivelasco January 21, 2022 20:14
Copy link
Copy Markdown
Contributor

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding @javivelasco as a reviewer since it looks like this error was introduced in #32368

javivelasco
javivelasco previously approved these changes Jan 21, 2022
Co-authored-by: Steven <steven@ceriously.com>
ijjk
ijjk previously approved these changes Jan 21, 2022
@kodiakhq kodiakhq Bot merged commit f4c1594 into vercel:canary Jan 21, 2022
Comment thread docs/middleware.md

## Custom Server

When using a custom server with middleware, you must specify the hostname and port when instantiating your `NextApp`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be moved to the Custom Server docs, since it only applies to a very small segment of Next.js users who are ejecting for a custom server.

kodiakhq Bot pushed a commit that referenced this pull request Jan 27, 2022
This moves the note about custom server handling for middleware to the custom server document. 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: #33535 (comment)
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Middleware fails in v12.0.8

5 participants