Skip to content
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

Update middleware documentation for custom server #33535

Merged
merged 4 commits into from
Jan 21, 2022

Conversation

saevarb
Copy link
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.
docs/middleware.md Outdated Show resolved Hide resolved
Copy link
Member

@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
@@ -76,6 +76,18 @@ Middleware runs directly after `redirects` and `headers`, before the first files

Middleware uses a [strict runtime](/docs/api-reference/edge-runtime.md) that supports standard Web APIs like `fetch`. This works out of the box using `next start`, as well as on Edge platforms like Vercel, which use [Edge Functions](http://www.vercel.com/edge).

## Custom Server

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

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)
natew pushed a commit to natew/next.js that referenced this pull request Feb 16, 2022
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. Fixes vercel#33450 which seems to have been erroneously closed.



## Bug

- [X] 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`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
natew pushed a commit to natew/next.js that referenced this pull request Feb 16, 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: vercel#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