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

On-demand revalidation with dynamic routes #43345

Open
1 task
A-Emile opened this issue Nov 24, 2022 · 2 comments
Open
1 task

On-demand revalidation with dynamic routes #43345

A-Emile opened this issue Nov 24, 2022 · 2 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@A-Emile
Copy link

A-Emile commented Nov 24, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.8.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.0.5
eslint-config-next: 13.0.5
react: 18.2.0
react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

next start

Describe the Bug

When I call res.revalidate("path-to-dynamic-route") on a dynamic route, I get the following error:

TypeError: res.hasHeader is not a function
    at Object.setRevalidateHeaders (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\send-payload\revalidate-headers.js:8:37)
    at NextNodeServer.sendRenderResult (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\next-server.js:380:34)
    at NextNodeServer.pipe (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\base-server.js:418:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.fn (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\next-server.js:744:21)
    at async Router.execute (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\router.js:252:36)
    at async NextNodeServer.run (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\base-server.js:383:29)
    at async NextNodeServer.handleRequest (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\base-server.js:321:20)
    at async revalidate (C:\Users\pc\DEV\glugano\node_modules\next\dist\server\api-utils\node.js:288:13)

Expected Behavior

The route gets revalidated

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://github.com/A-Emile/glugano

To Reproduce

  1. Create a dynamic route that fetches some data.
  2. Create api endpoint to revalidate the dynamic route
  3. Build the app (yarn build)
  4. Run the app (yarn start)
@A-Emile A-Emile added the bug Issue was opened via the bug report template. label Nov 24, 2022
@Fredkiss3
Copy link
Contributor

Your reproduction link seems to not exists.
And I would suggest to setup your reproduction code by doing at least the first and second steps that you listed.

@vercel-release-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@vercel-release-bot vercel-release-bot added the stale The issue has not seen recent activity. label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

3 participants