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: Static incremental builds errors #88

Merged
merged 2 commits into from
Jun 2, 2022
Merged

fix: Static incremental builds errors #88

merged 2 commits into from
Jun 2, 2022

Conversation

tlgimenes
Copy link
Contributor

What's the purpose of this pull request?

Fix wrong 404 during SSG

How does it work?

When an error occurs while fetching data needed for pages during SSG, our code threats this as a notFound. This notFound is SSG and this page will be notFound until we make a new deploy. This PR fixes this issue by throwing and error if an error occurs, making this page to be re-generated on the next request, thus generating the right page.

How to test it?

  1. Run yarn build && yarn serve on your machine
  2. Remove internet access (disable wifi) from your machine to simulate a communication error between the server and VTEX commerce platform
  3. Enter in a PDP. You should see the 500 error page.
  4. Re-enable the wifi and refresh. You should now see the correct page.

@tlgimenes tlgimenes added the Bug Fixes Something isn't working label Jun 2, 2022
@tlgimenes tlgimenes requested a review from a team June 2, 2022 13:50
@vercel
Copy link

vercel bot commented Jun 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nextjs-store-storybook ✅ Ready (Inspect) Visit Preview Jun 2, 2022 at 5:31PM (UTC)

@vercel vercel bot temporarily deployed to preview June 2, 2022 13:51 Inactive
@vercel vercel bot temporarily deployed to preview June 2, 2022 13:53 Inactive
@vtex-sites
Copy link

vtex-sites bot commented Jun 2, 2022

Preview is ready

This pull request generated a Preview

👀   Preview: https://sfj-8ac879d--nextjs.preview.vtex.app
🔬   Go deeper by inspecting the Build Logs
📝   based on commit 8ac879d

@vercel vercel bot temporarily deployed to preview June 2, 2022 13:59 Inactive
@vtex-sites
Copy link

vtex-sites bot commented Jun 2, 2022

Lighthouse Reports

Here are the Lighthouse reports of this Pull Request

📝 Based on commit 8ac879d

Lighthouse Report by page
📎   /
📎   /apple-magic-mouse-99988212/p
📎   /office

@vercel vercel bot temporarily deployed to preview June 2, 2022 14:27 Inactive
@vercel vercel bot temporarily deployed to preview June 2, 2022 14:45 Inactive
Copy link
Contributor

@filipewl filipewl left a comment

Choose a reason for hiding this comment

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

Looks good to me once #89 is in with the LH fixes!

@vercel vercel bot temporarily deployed to preview June 2, 2022 17:18 Inactive
@vercel vercel bot temporarily deployed to preview June 2, 2022 17:31 Inactive
@tlgimenes tlgimenes merged commit 8ac879d into main Jun 2, 2022
@tlgimenes tlgimenes deleted the fix/error-pages branch June 2, 2022 17:38
@tlgimenes tlgimenes mentioned this pull request Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fixes Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants