Skip to content

fix: remove Next.js as a peer dependency #1584

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 2 commits into from
Aug 31, 2022
Merged

Conversation

ericapisani
Copy link

@ericapisani ericapisani commented Aug 31, 2022

Summary

Removes Next.js as a peer dependency within the runtime package as at times it was leading to multiple version of Next.js being installed, and incompatible versions being bundled with the functions when the project was using an older version.

Test plan

Deploy preview: https://ep-next-test.netlify.app/

The https://ep-next-test.netlify.app/api/hello route is an SSR route

Test case provided in issue: https://ep-hbo-clone.netlify.app/movie (this should render correctly, no error)

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

Fixes https://github.com/netlify/pod-ecosystem-frameworks/issues/220

was leading to wrong version of next.js being bundled in with functions.
specifically, a newer version next would be installed when the project
uses an older (and at times incompatible with the newer) versoin
@ericapisani ericapisani added the type: bug code to address defects in shipped code label Aug 31, 2022
@ericapisani ericapisani self-assigned this Aug 31, 2022
@ericapisani ericapisani requested a review from a team August 31, 2022 16:03
@netlify
Copy link

netlify bot commented Aug 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/630f866dfcd8ba00080609c0
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/next-hp-edge-demo/deploys/630f866d5b759300083756a3
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/630f866d78a03c0009edb99b
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/630f866da297be000a6d0573
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/630f866d5951bd000708dbaf
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/630f866d49e3310008791991
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/630f866d140904000915ccbf
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/630f866d56f068000805d588
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/630f866d140904000915ccba
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/630f866d7dc48d0008c86b70
😎 Deploy Preview https://deploy-preview-1584--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 31, 2022

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

Name Link
🔨 Latest commit 9181456
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/630f866d7dc48d0008c86b75
😎 Deploy Preview https://deploy-preview-1584--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

@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.

This makes sense based on the issue @danez reported and folks will always have Next installed since the runtime is for Next. 😎

@kodiakhq kodiakhq bot merged commit 6be4dc0 into main Aug 31, 2022
@kodiakhq kodiakhq bot deleted the ep-remove-peer-dependency branch August 31, 2022 17:34
@ascorbic
Copy link
Contributor

ascorbic commented Sep 1, 2022

folks will always have Next installed since the runtime is for Next. 😎

This is why I thought it would be safe to have it as a peer dep. :old man yells at npm 7 peer dependencies: I've also had build errors importing it when it's not listed as a peer dep. Presumably this is working ok, but it is worth looking out for.

@danez
Copy link

danez commented Sep 2, 2022

In that case adding it as dev dependency would work. As our ci only installs production dependencies.

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.

4 participants