Skip to content

Fix prerendered dynamic ISR functions change in Vercel CLI #834

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

Conversation

james-elicx
Copy link
Contributor

@james-elicx james-elicx commented Jul 22, 2024

new vercel cli update no longer generates prerender configs for dynamic ISR functions when it generates valid children for the route.

this pr does the following:

  • checks if invalid func is a dynamic isr function
  • if it is, it checks if there is prerendered function for the dynamic routes sourcepath
  • if there are, it marks the dynamic function as ignored.

fixes #833

source path in prerender config for reference:

image image

Copy link

changeset-bot bot commented Jul 22, 2024

🦋 Changeset detected

Latest commit: 0977ef3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/next-on-pages Patch
eslint-plugin-next-on-pages Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

🧪 Prereleases are available for testing 🧪

@cloudflare/next-on-pages

You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/10039763616/npm-package-next-on-pages-834

@cloudflare/eslint-plugin-next-on-pages

You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/next-on-pages/runs/10039763616/npm-package-eslint-plugin-next-on-pages-834

@james-elicx james-elicx marked this pull request as ready for review July 22, 2024 11:33
Copy link
Member

@dario-piotrowicz dario-piotrowicz 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, thanks a lot for the fix @james-elicx 🙏

I've just left a few minor comments

@dario-piotrowicz dario-piotrowicz merged commit 2527917 into cloudflare:main Jul 28, 2024
8 checks passed
@james-elicx james-elicx deleted the james/fix-prerendered-invalid branch July 28, 2024 16:57
@valentinbdv
Copy link

Hi @dario-piotrowicz and @james-elicx. Thank you so much for your responsiveness in finding this quick fix. I'm currently stuck with this problem, so to see it progressing at this rate is great!
Do you know when the fix will be available using the command npx @cloudflare/next-on-pages@1? I'd like to know approximately when I'll be able to publish my project again.
Have a wonderful day ;)

@dario-piotrowicz
Copy link
Member

Hi @valentinbdv 🙂, no problem (well, James did all the work here! :P)

I'm sorry you've been blocked, if you want this should already be available in npx @cloudflare/next-on-pages@beta (since we publish that on every merge)

Or in any case I will cut a next-on-pages stable release today at some point, so by tomorrow npx @cloudflare/next-on-pages@1 should also include the fix 🙂

@valentinbdv
Copy link

Hi @dario-piotrowicz, I can confirm it does work now using npx @cloudflare/next-on-pages@beta !!
Tomorrow is perfect, thanks again ;)

@dario-piotrowicz
Copy link
Member

@valentinbdv nice! 😄 anyways I've also just done a stable release so feel free to go back to @1 🙂

@valentinbdv
Copy link

Hi @dario-piotrowicz, it seems that npx @cloudflare/next-on-pages@1 still doesn't include the fix unfortunately while there is a new version published after your fix.
How long do you think it will take then? Thanks!

@valentinbdv
Copy link

Oh sorry, I forgot to upgrade next-on-pages@1 before testing again. It works now ;)
For your information, I still have the warning message Invalid prerender config for /target/[target] but this is maybe due to something else.

@JoE11-y
Copy link

JoE11-y commented Aug 7, 2024

HI @dario-piotrowicz, I tried and still can't seem to get it to work?

@dario-piotrowicz
Copy link
Member

@JoE11-y can you make sure that you're using the latest (1.13.2) version of next-on-pages?

To be sure you can check the version that gets printed when you run the build command:
Screenshot 2024-08-11 at 22 29 02

If you're indeed using the latest next-on-pages version and it still doesn't work for you, could you please open a new issue with a minimal reproduction? (and I'll look into it as soon as I can) 🙏

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]: Failed to generate SSG dynamic routes due to Vercel CLI breaking change
4 participants