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

Bug: Suspense | client component should have a queue #44686

Closed
1 task done
xiel opened this issue Jan 7, 2023 · 4 comments
Closed
1 task done

Bug: Suspense | client component should have a queue #44686

xiel opened this issue Jan 7, 2023 · 4 comments
Labels
bug Issue was opened via the bug report template.

Comments

@xiel
Copy link

xiel commented Jan 7, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js 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

  1. Suspend using a (fake) promise in a client component in app dir (next)
  2. Try to useState after the use() call
'use client';

import { use, useState } from 'react';

const testPromise = new Promise((resolve) => {
  setTimeout(() => {
    resolve('use test promise');
  });
});

export default function Page() {
  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

@xiel xiel added the bug Issue was opened via the bug report template. label Jan 7, 2023
@govind15496

This comment was marked as off-topic.

@xiel
Copy link
Author

xiel commented Jan 7, 2023

@govind15496 Did ChatGPT write this for you? No need to spam my issues, thank you.

@eps1lon
Copy link
Member

eps1lon commented Jan 18, 2023

We can close this in favor of facebook/react#25964 since we've confirmed this is a bug and a fix is being worked on.

@xiel xiel closed this as completed Jan 19, 2023
@xiel xiel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2023
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants