@@ -1343,7 +1343,8 @@ describe('ReactUse', () => {
1343
1343
} ) ;
1344
1344
assertLog ( [ 'Async text requested [Hi]' ] ) ;
1345
1345
assertConsoleErrorDev ( [
1346
- 'async/await is not yet supported in Client Components, only Server Components. ' +
1346
+ '<App> is an async Client Component. ' +
1347
+ 'Only Server Components can be async at the moment. ' +
1347
1348
"This error is often caused by accidentally adding `'use client'` " +
1348
1349
'to a module that was originally written for the server.\n' +
1349
1350
' in App (at **)' ,
@@ -1443,7 +1444,8 @@ describe('ReactUse', () => {
1443
1444
} ) ;
1444
1445
assertLog ( [ 'A' , 'Mount: A' ] ) ;
1445
1446
assertConsoleErrorDev ( [
1446
- 'async/await is not yet supported in Client Components, only Server Components. ' +
1447
+ '<App> is an async Client Component. ' +
1448
+ 'Only Server Components can be async at the moment. ' +
1447
1449
"This error is often caused by accidentally adding `'use client'` " +
1448
1450
'to a module that was originally written for the server.\n' +
1449
1451
' in App (at **)' ,
@@ -1915,25 +1917,29 @@ describe('ReactUse', () => {
1915
1917
) ;
1916
1918
} ) ;
1917
1919
assertConsoleErrorDev ( [
1918
- 'async/await is not yet supported in Client Components, only Server Components. ' +
1920
+ '<AsyncClientComponent> is an async Client Component. ' +
1921
+ 'Only Server Components can be async at the moment. ' +
1919
1922
"This error is often caused by accidentally adding `'use client'` " +
1920
1923
'to a module that was originally written for the server.\n' +
1921
1924
' in AsyncClientComponent (at **)' +
1922
1925
( gate ( 'enableOwnerStacks' ) ? '' : '\n in ErrorBoundary (at **)' ) ,
1923
1926
] ) ;
1924
1927
assertLog ( [
1925
- 'async/await is not yet supported in Client Components, only Server ' +
1926
- 'Components. This error is often caused by accidentally adding ' +
1928
+ 'An unknown Component is an async Client Component. ' +
1929
+ 'Only Server Components can be async at the moment. ' +
1930
+ 'This error is often caused by accidentally adding ' +
1927
1931
"`'use client'` to a module that was originally written for " +
1928
1932
'the server.' ,
1929
- 'async/await is not yet supported in Client Components, only Server ' +
1930
- 'Components. This error is often caused by accidentally adding ' +
1933
+ 'An unknown Component is an async Client Component. ' +
1934
+ 'Only Server Components can be async at the moment. ' +
1935
+ 'This error is often caused by accidentally adding ' +
1931
1936
"`'use client'` to a module that was originally written for " +
1932
1937
'the server.' ,
1933
1938
] ) ;
1934
1939
expect ( root ) . toMatchRenderedOutput (
1935
- 'async/await is not yet supported in Client Components, only Server ' +
1936
- 'Components. This error is often caused by accidentally adding ' +
1940
+ 'An unknown Component is an async Client Component. ' +
1941
+ 'Only Server Components can be async at the moment. ' +
1942
+ 'This error is often caused by accidentally adding ' +
1937
1943
"`'use client'` to a module that was originally written for " +
1938
1944
'the server.' ,
1939
1945
) ;
@@ -1967,25 +1973,29 @@ describe('ReactUse', () => {
1967
1973
) ;
1968
1974
} ) ;
1969
1975
assertConsoleErrorDev ( [
1970
- 'async/await is not yet supported in Client Components, only Server Components. ' +
1976
+ '<AsyncClientComponent> is an async Client Component. ' +
1977
+ 'Only Server Components can be async at the moment. ' +
1971
1978
"This error is often caused by accidentally adding `'use client'` " +
1972
1979
'to a module that was originally written for the server.\n' +
1973
1980
' in AsyncClientComponent (at **)' +
1974
1981
( gate ( 'enableOwnerStacks' ) ? '' : '\n in ErrorBoundary (at **)' ) ,
1975
1982
] ) ;
1976
1983
assertLog ( [
1977
- 'async/await is not yet supported in Client Components, only Server ' +
1978
- 'Components. This error is often caused by accidentally adding ' +
1984
+ 'An unknown Component is an async Client Component. ' +
1985
+ 'Only Server Components can be async at the moment. ' +
1986
+ 'This error is often caused by accidentally adding ' +
1979
1987
"`'use client'` to a module that was originally written for " +
1980
1988
'the server.' ,
1981
- 'async/await is not yet supported in Client Components, only Server ' +
1982
- 'Components. This error is often caused by accidentally adding ' +
1989
+ 'An unknown Component is an async Client Component. ' +
1990
+ 'Only Server Components can be async at the moment. ' +
1991
+ 'This error is often caused by accidentally adding ' +
1983
1992
"`'use client'` to a module that was originally written for " +
1984
1993
'the server.' ,
1985
1994
] ) ;
1986
1995
expect ( root ) . toMatchRenderedOutput (
1987
- 'async/await is not yet supported in Client Components, only Server ' +
1988
- 'Components. This error is often caused by accidentally adding ' +
1996
+ 'An unknown Component is an async Client Component. ' +
1997
+ 'Only Server Components can be async at the moment. ' +
1998
+ 'This error is often caused by accidentally adding ' +
1989
1999
"`'use client'` to a module that was originally written for " +
1990
2000
'the server.' ,
1991
2001
) ;
@@ -2012,7 +2022,8 @@ describe('ReactUse', () => {
2012
2022
// decided to warn for _any_ async client component regardless of
2013
2023
// whether the update is sync. But if we ever add back support for async
2014
2024
// client components, we should add back the hook warning.
2015
- 'async/await is not yet supported in Client Components, only Server Components. ' +
2025
+ '<AsyncClientComponent> is an async Client Component. ' +
2026
+ 'Only Server Components can be async at the moment. ' +
2016
2027
"This error is often caused by accidentally adding `'use client'` " +
2017
2028
'to a module that was originally written for the server.\n' +
2018
2029
' in AsyncClientComponent (at **)' ,
@@ -2044,7 +2055,8 @@ describe('ReactUse', () => {
2044
2055
// decided to warn for _any_ async client component regardless of
2045
2056
// whether the update is sync. But if we ever add back support for async
2046
2057
// client components, we should add back the hook warning.
2047
- 'async/await is not yet supported in Client Components, only Server Components. ' +
2058
+ '<AsyncClientComponent> is an async Client Component. ' +
2059
+ 'Only Server Components can be async at the moment. ' +
2048
2060
"This error is often caused by accidentally adding `'use client'` " +
2049
2061
'to a module that was originally written for the server.\n' +
2050
2062
' in AsyncClientComponent (at **)' ,
@@ -2079,7 +2091,8 @@ describe('ReactUse', () => {
2079
2091
} ) ;
2080
2092
} ) ;
2081
2093
assertConsoleErrorDev ( [
2082
- 'async/await is not yet supported in Client Components, only Server Components. ' +
2094
+ '<App> is an async Client Component. ' +
2095
+ 'Only Server Components can be async at the moment. ' +
2083
2096
"This error is often caused by accidentally adding `'use client'` " +
2084
2097
'to a module that was originally written for the server.\n' +
2085
2098
' in App (at **)' ,
0 commit comments