Replies: 7 comments 6 replies
-
Anyone have any insight. I've been battling with this warning all throughout my apps. |
Beta Was this translation helpful? Give feedback.
-
This may solve your issue by using dynamic importExample Code:'use client'
import { useState } from 'react'
import dynamic from 'next/dynamic'
// Client Components:
const ComponentA = dynamic(() => import('../components/A'))
const ComponentB = dynamic(() => import('../components/B'))
const ComponentC = dynamic(() => import('../components/C'), { ssr: false })
export default function ClientComponentExample() {
const [showMore, setShowMore] = useState(false)
return (
<div>
{/* Load immediately, but in a separate client bundle */}
<ComponentA />
{/* Load on demand, only when/if the condition is met */}
{showMore && <ComponentB />}
<button onClick={() => setShowMore(!showMore)}>Toggle</button>
{/* Load only on the client side */}
<ComponentC />
</div>
)
} |
Beta Was this translation helpful? Give feedback.
-
You need to check your Actually, the text of the error hints at that. The promise must be kept in a location external to the suspended component. |
Beta Was this translation helpful? Give feedback.
-
Our issue was with SWR. I swapped the library to Tanstack Query and the warnings have disappeared. |
Beta Was this translation helpful? Give feedback.
-
I am getting this issue after creating a |
Beta Was this translation helpful? Give feedback.
-
This error occurs when you try to use Server-Side Rendering (SSR) within a Client Component in frameworks like Next.js import dynamic from "next/dynamic"; |
Beta Was this translation helpful? Give feedback.
-
For anyone still having this problem, I was able to resolve it by wrapping the offending component in React Suspense:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
On upgrade to 14.2.2 from 14.1.x im now receiving this warning:
app-index.js:33 Warning: A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.
at AuthProvider
at f (webpack-internal:///(app-pages-browser)/./node_modules/next-themes/dist/index.module.js:8:597)
at $ (webpack-internal:///(app-pages-browser)/./node_modules/next-themes/dist/index.module.js:8:348)
at ThemeProvider (webpack-internal:///(app-pages-browser)/./src/components/theme/theme-provider.tsx:13:11)
at body
at html
at RootLayout (Server)
Is there a change I need to make now?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions