-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stack trace to client rendering bailout error (#61200)
When there's `useSearchParams` hook triggers the bailout to client side rendering, users might hard to find where it's from since it could either from users code base or third party libraries. Adding the stack trace for it so they could at least investigate which line is throwing from the server bundle. Will improve it in the later future when we can give more insights. #### After ``` ⨯ useSearchParams() should be wrapped in a suspense boundary at page "/". Read more: https:// nextjs.org/docs/messages/missing-suspense-with-csr-bailout at a (/private/var/folders/gy/kq4zjn8s0ljf9sfjyyh_nj640000gn/T/next-install-aa5f331b7f6af2 82fd9bab0f69685454d1f50dc8f3c775da23d4e5e807a970cb/.next/server/chunks/846.js:1:9912) at h (/private/var/folders/gy/kq4zjn8s0ljf9sfjyyh_nj640000gn/T/next-install-aa5f331b7f6af2 82fd9bab0f69685454d1f50dc8f3c775da23d4e5e807a970cb/.next/server/chunks/846.js:1:22018) at a (/private/var/folders/gy/kq4zjn8s0ljf9sfjyyh_nj640000gn/T/next-install-aa5f331b7f6af2 82fd9bab0f69685454d1f50dc8f3c775da23d4e5e807a970cb/.next/server/app/page.js:1:2518) ``` #### Before ``` ⨯ useSearchParams() should be wrapped in a suspense boundary at page "/". Read more: https:// nextjs.org/docs/messages/missing-suspense-with-csr-bailout ``` Closes NEXT-2239
- Loading branch information
Showing
8 changed files
with
59 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
test/e2e/app-dir/missing-suspense-with-csr-bailout/app/layout-no-suspense.js
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
test/e2e/app-dir/missing-suspense-with-csr-bailout/app/layout-suspense.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Suspense } from 'react' | ||
|
||
export default function Layout({ children }) { | ||
return ( | ||
<html> | ||
<head /> | ||
<body> | ||
<Suspense fallback={<div>Loading...</div>}>{children}</Suspense> | ||
</body> | ||
</html> | ||
) | ||
} |
6 changes: 1 addition & 5 deletions
6
test/e2e/app-dir/missing-suspense-with-csr-bailout/app/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
import { Suspense } from 'react' | ||
|
||
export default function Layout({ children }) { | ||
return ( | ||
<html> | ||
<head /> | ||
<body> | ||
<Suspense fallback={<div>Loading...</div>}>{children}</Suspense> | ||
</body> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters