Skip to content

fix: default to target: server, not serverless #2060

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 1 commit into from
Apr 21, 2023
Merged

Conversation

orinokai
Copy link
Contributor

@orinokai orinokai commented Apr 21, 2023

Summary

In v13.3.0, Next.js shipped a change that removed the target parameter from the Next config object. It was deprecated in Next 12 (and its usage discontinued in 12.3.2), but this recent change means the value is undefined instead of defaulting to server, which causes our Runtime to not find any static files to move to the CDN.

This PR simply flips the logic so that 'server' is the default instead of 'serverless'. This works because the default directory for static files is .next/server.

Test plan

Tests should pass as before.

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

Fixes #2043

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 Apr 21, 2023

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

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/6442ba072e9625000893efbb
😎 Deploy Preview https://deploy-preview-2060--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 Apr 21, 2023

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

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/6442ba07244fe20008f4432d
😎 Deploy Preview https://deploy-preview-2060--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.

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Apr 21, 2023
@netlify
Copy link

netlify bot commented Apr 21, 2023

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

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/6442ba075bbb910007065235
😎 Deploy Preview https://deploy-preview-2060--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 Apr 21, 2023

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

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/6442ba07183749000887e0b2
😎 Deploy Preview https://deploy-preview-2060--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 Apr 21, 2023

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

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/6442ba0756e93d00096b29bb
😎 Deploy Preview https://deploy-preview-2060--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 Apr 21, 2023

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

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/6442ba07408bfb00086fc3a6
😎 Deploy Preview https://deploy-preview-2060--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 Apr 21, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/6442ba0756e93d00096b29b6
😎 Deploy Preview https://deploy-preview-2060--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 Apr 21, 2023

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

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/6442ba07fb707e00088419b8
😎 Deploy Preview https://deploy-preview-2060--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 Apr 21, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 0f367c4
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/6442ba07ffe91a00089826b0
😎 Deploy Preview https://deploy-preview-2060--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.

@orinokai orinokai marked this pull request as ready for review April 21, 2023 17:45
@orinokai orinokai requested a review from a team April 21, 2023 17:45
Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

I'm assuming our existing tests cover this change so 🚢 !

@kodiakhq kodiakhq bot merged commit 61c2458 into main Apr 21, 2023
@kodiakhq kodiakhq bot deleted the rs/target-undefined branch April 21, 2023 18:02
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]: 404 page for static routes using getStatic...
2 participants