Skip to content

fix: add better error messaging for builds #1467

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 3 commits into from
Jul 14, 2022
Merged

Conversation

ericapisani
Copy link

Summary

Adds better error messaging for when:

  • a user has a built site that's not detected
  • the user has set the publish directory to something other than .next
  • the netlify plugin detects a production build in the .next folder

Test plan

  • Go to demos/default test project and build it such that there's a production build in the .next
  • Change the publish directory in demos/default/netlify.toml to something other than .next
  • Attempt to build the project using ntl build

Expected behaviour: You should see an updated error message prompting you to set the 'publish' directory to .next due to detecting the presence of a production build in that directory

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

Fixed #1362

@ericapisani ericapisani added the type: bug code to address defects in shipped code label Jul 13, 2022
@ericapisani ericapisani requested a review from a team July 13, 2022 19:00
@ericapisani ericapisani self-assigned this Jul 13, 2022
@netlify
Copy link

netlify bot commented Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/62d0214d79c2c4000991e9ba
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/62d0214e276a79000900436e
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/next-hp-edge-demo/deploys/62d0214e9ead360008c26bc3
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/62d0214e03a0d1000992f18a
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/62d0214e8af6670008cf29e0
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/62d0214ea0ce5d00087bf032
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/62d0214e03a0d1000992f18f
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/62d0214e205d450008120819
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/62d0214ea6e63a0008c00936
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit fb0c55b
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/62d0214e4224b30008f415d9
😎 Deploy Preview https://deploy-preview-1467--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 Jul 13, 2022

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

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

@cypress
Copy link

cypress bot commented Jul 13, 2022



Test summary

22 0 0 0


Run details

Project netlify-plugin-nextjs-default-demo
Status Passed
Commit 52bf3de ℹ️
Started Jul 13, 2022 7:03 PM
Ended Jul 13, 2022 7:04 PM
Duration 01:34 💡
OS Linux Ubuntu - 20.04
Browser Chrome 103

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 Jul 13, 2022



Test summary

7 0 0 0


Run details

Project netlify-plugin-nextjs-static-demo
Status Passed
Commit 52bf3de ℹ️
Started Jul 13, 2022 7:03 PM
Ended Jul 13, 2022 7:04 PM
Duration 01:16 💡
OS Linux Ubuntu - 20.04
Browser Chrome 103

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 Jul 13, 2022



Test summary

2 0 0 0


Run details

Project netlify-plugin-nextjs-nx-monorepo-demo
Status Passed
Commit 52bf3de ℹ️
Started Jul 13, 2022 7:04 PM
Ended Jul 13, 2022 7:05 PM
Duration 01:18 💡
OS Linux Ubuntu - 20.04
Browser Chrome 103

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

it('returns error message about incorrectly publishing the ".next" directory when "next export" was run', () => {
existsSync.mockReturnValue(true)

const expectedFailureMessage = outdent`

Choose a reason for hiding this comment

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

Can we make this a const to avoid wording change errors?

Copy link

@sarahetter sarahetter left a comment

Choose a reason for hiding this comment

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

Just one dust comment, LGTM

Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

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

Nice! Much better

@kodiakhq kodiakhq bot merged commit 1d90f68 into main Jul 14, 2022
@kodiakhq kodiakhq bot deleted the ep/warn-if-build-missing branch July 14, 2022 14: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.

Warn if build missing and directory is not .next
3 participants