question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"hostname" and "port" must be provided when starting next to use "unstable_revalidate"

See original GitHub issue

Issue Summary

I want to use req.unstable_revalidate for ISG. Reading here it seems supported.

Actual behavior

If I call req.unstable_revalidate inside an api I got this error:

"hostname" and "port" must be provided when starting next to use "unstable_revalidate". See more here https://nextjs.org/docs/advanced-features/custom-server

I can’t get any actual information about this problem at the provided url. Also, checking the code generated inside .next/serverless/chunk/ I don’t think I can pass hostname and port parameters, because the function accept only one parameter:

apiRes.unstable_revalidate = (urlPath)=>unstable_revalidate(urlPath, req, apiContext)

Looking for the round of calls that are made previously, I don’t even seem to be able to modify this apiContext.

(Locally works fine)

Versions

Checklist

  • You have reviewed the README and FAQs, which answers several common questions.
  • You have reviewed our DEBUGGING wiki and have tried your best to include complete information and reproduction steps (including your configuration) as is possible. As there is only one maintainer (who maintains this in his free time) and thus very limited resources, if you have time, please try to debug the issue a bit yourself if possible.
  • You have first tried using the most recent latest or alpha @sls-next/serverless-component release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

2reactions
chandank-nucommented, Mar 25, 2022

AFAIK base ISR feature is working where you add the revalidate prop to getStaticProps. If you are referring to 12.1 release’s On-demand Incremental Static Regeneration, it should not be working.

Hi, Do you know if there is any plan to add this feature?

0reactions
Lea23VCcommented, Nov 22, 2022

AFAIK base ISR feature is working where you add the revalidate prop to getStaticProps. If you are referring to 12.1 release’s On-demand Incremental Static Regeneration, it should not be working.

Hi, Do you know if there is any plan to add this feature?

Any update?, trying to use On-demand ISR gives me “Invariant: required internal revalidate method not passed to api-utils”

Read more comments on GitHub >

github_iconTop Results From Across the Web

r/nextjs - Next.js 12.1: On-demand ISR, support for styled- ...
Now I can use unstable_revalidate ! Hopefully that saves Vercel a bunch of CPU cycles ;).
Read more >
Next.js CLI
The Next.js CLI allows you to start, build, and export your application. To get a list of the available CLI commands, run the...
Read more >
nxのNext.jsでもOn-demand Incremental Static ...
nxのNext.jsでもOn-demand Incremental Static Regenerationしたい ... Error: "hostname" and "port" must be provided when starting next to use ...
Read more >
node.js - 503 Service Unavailable. The server is ...
Finally, I solved my problem by changing the node version of web application in cpanel. In fact, the problem was that I was...
Read more >
A Complete Guide To Incremental Static Regeneration ...
With Next.js, you can continue using your existing code and add as much (or as little) React as you need. By starting small...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found