Skip to content

feat: improve messaging on middleware detection #1575

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 4 commits into from
Aug 26, 2022

Conversation

ericapisani
Copy link

Summary

Improve middleware messaging when middleware is not detected in a site. At the moment it appears like something is wrong if a site does not have middleware due to the middleware path not being able to be resolved in the execa calls.

Test plan

Tested running ntl dev when the middleware file is not there, is in JS, or is in TS.

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

bluejay

@ericapisani ericapisani added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Aug 26, 2022
@ericapisani ericapisani requested a review from a team August 26, 2022 13:57
@ericapisani ericapisani self-assigned this Aug 26, 2022
@netlify
Copy link

netlify bot commented Aug 26, 2022

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

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/6308e46fb3fc640008e61402
😎 Deploy Preview https://deploy-preview-1575--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-hp-edge-demo ready!

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/next-hp-edge-demo/deploys/6308e46f1dc53000088691ce
😎 Deploy Preview https://deploy-preview-1575--next-hp-edge-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

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

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/6308e46f3006f60008755e86
😎 Deploy Preview https://deploy-preview-1575--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

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

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6308e46fd297450008a755ed
😎 Deploy Preview https://deploy-preview-1575--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

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

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/6308e46f4970450008e21e6a
😎 Deploy Preview https://deploy-preview-1575--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit b0c3398
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6308d169216f050008b83a21
😎 Deploy Preview https://deploy-preview-1575--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-plugin-rsc-demo ready!

Name Link
🔨 Latest commit b0c3398
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/6308d1699f451700097d880a
😎 Deploy Preview https://deploy-preview-1575--next-plugin-rsc-demo.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit b0c3398
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6308d1694a50b200085c1d5d
😎 Deploy Preview https://deploy-preview-1575--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit b0c3398
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/6308d16923258b000bd2e349
😎 Deploy Preview https://deploy-preview-1575--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit b0c3398
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6308d16946a4ff0008b59d2e
😎 Deploy Preview https://deploy-preview-1575--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit b0c3398
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6308d169cf47e20008cac554
😎 Deploy Preview https://deploy-preview-1575--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-plugin-rsc-demo ready!

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/6308e46ff72ec60007025acb
😎 Deploy Preview https://deploy-preview-1575--next-plugin-rsc-demo.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6308e46f068af400086dd577
😎 Deploy Preview https://deploy-preview-1575--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/6308e46f1dc53000088691ca
😎 Deploy Preview https://deploy-preview-1575--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6308e46fbda33d000919b981
😎 Deploy Preview https://deploy-preview-1575--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6308e46f068af400086dd57c
😎 Deploy Preview https://deploy-preview-1575--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 3b098cc
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6308e46fb3fc640008e6140a
😎 Deploy Preview https://deploy-preview-1575--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@orinokai orinokai left a comment

Choose a reason for hiding this comment

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

Unless I'm mistaken, if middleware isn't detected then we don't need to run esbuild at all?

@ericapisani
Copy link
Author

@orinokai You're correct, good catch. I've moved the execa calls to within the else block so we also can get rid of the flag I initially introduced

Copy link
Contributor

@orinokai orinokai left a comment

Choose a reason for hiding this comment

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

Woo! LGTM 🚀

@kodiakhq kodiakhq bot merged commit 73d6b8e into main Aug 26, 2022
@kodiakhq kodiakhq bot deleted the improve-middleware-messaging branch August 26, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants