Skip to content

fix: provide hostname and port to server #1149

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 7 commits into from
Jan 24, 2022
Merged

fix: provide hostname and port to server #1149

merged 7 commits into from
Jan 24, 2022

Conversation

ascorbic
Copy link
Contributor

Summary

As of [email protected], middleware requires NextServer to be instantiated with a port and hostname.

Test plan

  1. Visit middleware page on deploy preview

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

Fixes #1141

capybara

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@netlify
Copy link

netlify bot commented Jan 22, 2022

✔️ Deploy Preview for netlify-plugin-nextjs-demo ready!

🔨 Explore the source changes: 2bdc0e7

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/61eeb29f5a041c000718bd2d

😎 Browse the preview: https://deploy-preview-1149--netlify-plugin-nextjs-demo.netlify.app

@netlify
Copy link

netlify bot commented Jan 22, 2022

✔️ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

🔨 Explore the source changes: 2bdc0e7

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/61eeb29fc0d22e00079854b0

😎 Browse the preview: https://deploy-preview-1149--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jan 22, 2022
@netlify
Copy link

netlify bot commented Jan 22, 2022

✔️ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

🔨 Explore the source changes: 2bdc0e7

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/61eeb29f1b6f3500083a7f8a

😎 Browse the preview: https://deploy-preview-1149--netlify-plugin-nextjs-static-root-demo.netlify.app

@netlify
Copy link

netlify bot commented Jan 22, 2022

✔️ Deploy Preview for netlify-plugin-nextjs-export-demo ready!

🔨 Explore the source changes: 2bdc0e7

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/61eeb2a0d01a0f0007a19f14

😎 Browse the preview: https://deploy-preview-1149--netlify-plugin-nextjs-export-demo.netlify.app

@ascorbic ascorbic force-pushed the mk/next-server-host branch from 588caa4 to 70d6714 Compare January 22, 2022 11:56
@ascorbic ascorbic self-assigned this Jan 22, 2022
@ascorbic ascorbic requested a review from tiffafoo January 22, 2022 12:00
@cypress
Copy link

cypress bot commented Jan 22, 2022



Test summary

2 0 0 0


Run details

Project netlify-plugin-nextjs-nx-monorepo-demo
Status Passed
Commit 2212008 ℹ️
Started Jan 24, 2022 2:13 PM
Ended Jan 24, 2022 2:15 PM
Duration 01:08 💡
OS Linux Ubuntu - 20.04
Browser Chrome 97

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link

cypress bot commented Jan 22, 2022



Test summary

17 0 0 0


Run details

Project netlify-plugin-nextjs-default-demo
Status Passed
Commit 2212008 ℹ️
Started Jan 24, 2022 2:11 PM
Ended Jan 24, 2022 2:13 PM
Duration 01:35 💡
OS Linux Ubuntu - 20.04
Browser Chrome 97

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link

cypress bot commented Jan 22, 2022



Test summary

7 0 0 0


Run details

Project netlify-plugin-nextjs-static-demo
Status Passed
Commit 2212008 ℹ️
Started Jan 24, 2022 2:11 PM
Ended Jan 24, 2022 2:13 PM
Duration 01:18 💡
OS Linux Ubuntu - 20.04
Browser Chrome 97

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@ascorbic ascorbic changed the title fix: provide hostname and port fix: provide hostname and port to server Jan 22, 2022
// exit preview mode
cy.request('/api/exitPreview')
cy.visit('/previewTest')
cy.findByText('Is preview? No', { selector: 'h1' })

Choose a reason for hiding this comment

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

Why is Cypress in CI saying there is more than one instance of this text :confused-capybara:?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was baffled for ages, but if you look at the error in the dashboard, it seems there's a <p>, which is the route announcer (for screen readers)! No idea why it only shows for this route though.

tiffafoo
tiffafoo previously approved these changes Jan 24, 2022
@ascorbic
Copy link
Contributor Author

I changed the indentation level of the handler, so this is easier to review with whitespace hidden

@ascorbic ascorbic requested a review from tiffafoo January 24, 2022 10:39
@kodiakhq kodiakhq bot merged commit 02053fd into main Jan 24, 2022
@kodiakhq kodiakhq bot deleted the mk/next-server-host branch January 24, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Next.js middlewares are currently broken on Netlify
2 participants