Skip to content
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

fix: correctly cache when using next export #1223

Merged
merged 1 commit into from
Feb 17, 2022
Merged

fix: correctly cache when using next export #1223

merged 1 commit into from
Feb 17, 2022

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Feb 17, 2022

Summary

Currently we look for the cache inside the publish directory. Normally this is fine, because the publish directory is .next, however when using next export it has a different publish directory. This PR attempts to find the cache directory elsewhere if the site is using next export.

Test plan

  1. Observe the build of the next export demo site.
  2. Check that it finds the cache

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

Fixes #1192

two capybaras

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.

Sorry, something went wrong.

@ascorbic ascorbic self-assigned this Feb 17, 2022
@netlify
Copy link

netlify bot commented Feb 17, 2022

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

🔨 Explore the source changes: 7c31d90

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/620e5b19a7630300073fa012

😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-demo.netlify.app

@netlify
Copy link

netlify bot commented Feb 17, 2022

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

🔨 Explore the source changes: 7c31d90

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/620e5b194ed53c0008dc7f59

😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-static-root-demo.netlify.app

@netlify
Copy link

netlify bot commented Feb 17, 2022

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

🔨 Explore the source changes: 7c31d90

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/620e5b1933cb940008ca9f5f

😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-export-demo.netlify.app

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Feb 17, 2022
@netlify
Copy link

netlify bot commented Feb 17, 2022

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

🔨 Explore the source changes: 7c31d90

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/620e5b19cb6e5400081bf373

😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app

@cypress
Copy link

cypress bot commented Feb 17, 2022



Test summary

7 0 0 0


Run details

Project netlify-plugin-nextjs-static-demo
Status Passed
Commit 8774be3 ℹ️
Started Feb 17, 2022 2:31 PM
Ended Feb 17, 2022 2:33 PM
Duration 01:18 💡
OS Linux Ubuntu - 20.04
Browser Chrome 98

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 Feb 17, 2022



Test summary

21 1 0 0


Run details

Project netlify-plugin-nextjs-default-demo
Status Failed
Commit 8774be3 ℹ️
Started Feb 17, 2022 2:30 PM
Ended Feb 17, 2022 2:31 PM
Duration 01:34 💡
OS Linux Ubuntu - 20.04
Browser Chrome 98

View run in Cypress Dashboard ➡️


Failures

cypress/integration/default/middleware.spec.ts Failed
1 Middleware > should properly load custom headers

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 Feb 17, 2022



Test summary

2 0 0 0


Run details

Project netlify-plugin-nextjs-nx-monorepo-demo
Status Passed
Commit 8774be3 ℹ️
Started Feb 17, 2022 2:30 PM
Ended Feb 17, 2022 2:31 PM
Duration 01:07 💡
OS Linux Ubuntu - 20.04
Browser Chrome 98

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

console.log('Next.js cache restored.')
} else {
console.log('No Next.js cache to restore.')
}
}

export const saveCache = async ({ cache, publish }) => {
const cacheDir = join(publish, 'cache')

const buildManifest = join(publish, 'build-manifest.json')
Copy link

Choose a reason for hiding this comment

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

Just to confirm: was removing build-manifest.json as the digests option intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, because it seems like it's not an accurate indicator of whether the cache has changed.

Copy link

Choose a reason for hiding this comment

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

👍

ehmicky
ehmicky previously approved these changes Feb 17, 2022
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]: When using next export, cache not found
2 participants