Skip to content

fix: Respect pageExtensions config setting #2073

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
Apr 27, 2023
Merged

fix: Respect pageExtensions config setting #2073

merged 7 commits into from
Apr 27, 2023

Conversation

RohitRajendran
Copy link

@RohitRajendran RohitRajendran commented Apr 27, 2023

Summary

When using the custom page extensions setting for Next.JS, you'll see errors during the onBuild event saying that it could not find the source file for your api routes. This causes things like scheduled functions not to work.

I've updated it so that it uses provided pageExtensions from the next config if available. If not, it will fallback to the previously used array for extensions.

Test plan

  1. It should be tested with a NextJS config that has page extensions settings defined as well as without

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

Fixes #2072.

image

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality

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

@netlify
Copy link

netlify bot commented Apr 27, 2023

👷 Deploy request for netlify-plugin-nextjs-static-root-demo pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 101f14b

@netlify
Copy link

netlify bot commented Apr 27, 2023

👷 Deploy request for netlify-plugin-nextjs-nx-monorepo-demo pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 101f14b

@netlify
Copy link

netlify bot commented Apr 27, 2023

👷 Deploy request for netlify-plugin-nextjs-next-auth-demo pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 101f14b

@netlify
Copy link

netlify bot commented Apr 27, 2023

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

Name Link
🔨 Latest commit 101f14b
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/644a2a6251d5d00008179490
😎 Deploy Preview https://deploy-preview-2073--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 27, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 101f14b
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/644a2a6264a23f0008fcf70c
😎 Deploy Preview https://deploy-preview-2073--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 27, 2023

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

Name Link
🔨 Latest commit 101f14b
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/644a2a6272c8ec000827658c
😎 Deploy Preview https://deploy-preview-2073--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 27, 2023

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

Name Link
🔨 Latest commit 101f14b
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/644a2a6272c8ec0008276587
😎 Deploy Preview https://deploy-preview-2073--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 27, 2023

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

Name Link
🔨 Latest commit 101f14b
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/644a2a6382a82b0008b4aa0b
😎 Deploy Preview https://deploy-preview-2073--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 Apr 27, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 101f14b
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/644a2a62a5b3a60008ac0bb6
😎 Deploy Preview https://deploy-preview-2073--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.

@RohitRajendran RohitRajendran marked this pull request as ready for review April 27, 2023 04:32
@RohitRajendran RohitRajendran requested a review from a team April 27, 2023 04:32
@LekoArts LekoArts changed the title fix: use custom page extensions (if applicable) when looking for sour… fix: Respect pageExtensions config setting Apr 27, 2023
@LekoArts LekoArts self-assigned this Apr 27, 2023
Copy link

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Thanks 👍

I added some unit tests to validate the behavior

@LekoArts LekoArts merged commit 940cbbc into opennextjs:main Apr 27, 2023
@nickytonline
Copy link

Thanks for the PR @RohitRajendran!

@RohitRajendran
Copy link
Author

Hey @nickytonline / @LekoArts! Just curious if you had any idea when I could expect the next release? Would love to be able to start using scheduled functions with my project! 😀

@orinokai
Copy link
Contributor

Hey @RohitRajendran 👋🏼 this should now be fully rolled out. If you manually install the Next.js Runtime then you will need to update via NPM, otherwise the latest version should install during your next build. Thanks again for the PR!

@RohitRajendran
Copy link
Author

Hey @RohitRajendran 👋🏼 this should now be fully rolled out. If you manually install the Next.js Runtime then you will need to update via NPM, otherwise the latest version should install during your next build. Thanks again for the PR!

Thanks!! Got it working! 🙌🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Can't find source file when using custom page extensions
4 participants