router.refresh()
throws in specific Draft Mode conditions
#50935
Labels
area: app
App directory (appDir: true)
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Mon Dec 19 20:43:09 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T6000 Binaries: Node: 18.12.1 npm: 8.19.2 Yarn: N/A pnpm: N/A Relevant packages: next: 13.4.5-canary.7 eslint-config-next: 13.4.4 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/angeloashmore/next.js-issue-50935
To Reproduce
Start the development server before continuing.
With Draft Mode disabled
/foo
. The page should perform a client-side refresh every 1 second with no errors.With Draft Mode enabled
Go to
/draft
. You should be redirect to/foo
, now with Draft mode enabled.The page should perform a full browser refresh every 1 second with errors in the console.
🐛 It is supposed to perform a client-side refresh every 1 second.
To disable Draft Mode
/end-draft
.Describe the Bug
router.refresh()
throws a server error and forces a full browser refresh under the following circumstances:generateStaticParams()
.The following output prints to the server console when
router.refresh()
is called. The browser performs a full refresh rather than a client-side refresh.Expected Behavior
The page performs a client-side refresh. No errors are logged to the server console.
Which browser are you using? (if relevant)
Chrome 113.0.5672.126
How are you deploying your application? (if relevant)
N/A
The text was updated successfully, but these errors were encountered: