You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suspend using a (fake) promise in a client component in app dir (next)
Try to useState after the use() call
'use client';import{use,useState}from'react';consttestPromise=newPromise((resolve)=>{setTimeout(()=>{resolve('use test promise');});});exportdefaultfunctionPage(){use(testPromise);useState(0);return<h1>Test</h1>;}
Describe the Bug
Suspending for a promise in a client component and using state/reducer after results in errors during hydration:
react-dom.development.js?9d87:94 Warning: An error occurred during hydration. The server HTML was replaced with client
react-dom.development.js?9d87:94 Warning: You are accessing "digest" from the errorInfo object passed to onRecoverableError.
on-recoverable-error.js?eb92:17 Uncaught Error: Should have a queue. This is likely a bug in React. Please file an issue.
Expected Behavior
No error during hydration.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered:
xiel
added
the
bug
Issue was opened via the bug report template.
label
Jan 7, 2023
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
React version: 18.2.0
Next version: 13.1.1
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://codesandbox.io/s/github/xiel/app-playground/tree/suspense-error/?from-embed=&file=/app/page.tsx
To Reproduce
Describe the Bug
Suspending for a promise in a client component and using state/reducer after results in errors during hydration:
Expected Behavior
No error during hydration.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: