Next.js Discord

Discord Forum

How to use Suspense in _app.tsx?

Unanswered
Golden northern bumble bee posted this in #help-forum
Open in Discord
Golden northern bumble beeOP
Hi foks. I have a project on NextJS 12 and I need Suspense to wait for the loading of data. However, when I wrap my component into <Suspense/> it never resolves and just hanging on "loading..." forever. Any ideas what can go wrong?

25 Replies

Probably a better idea to switch to NextJS 13 before any of this
Nextjs 13 does support pages router.
Golden northern bumble beeOP
I can't switch to Next 13
It's difficult to find a sandbox with Next 12 support, I found some old template tho.
Here is an example of the problem:
Maybe I do something wrong, because I don't have much of experience with Suspense
If you open the index page - it's fine.
But if you click the About link, you'll see loading forever
Here is an example w/o Next and it works fine:
Why can you not switch to Next 13? Even if it was a problem we can't really help since you are literally a major version behind
Golden northern bumble beeOP
Becase there is a bunch of code?
Usual things
Next 13 is not fully backward compatible with Next 12
So no, can't switch
Golden northern bumble beeOP
Also, I wonder if support of Next 12 is over
Usually, support of majors continues for years
@Golden northern bumble bee Next 13 is not fully backward compatible with Next 12
As long as you follow the guide you should still be able to use Next 13 with Pages router.
You can upgrade from next 12 -> Next 13 without any problem.
just npm i next@latest
no need to migrate
@Golden northern bumble bee Next 13 is not fully backward compatible with Next 12
which part that is not backward compatible?
Original message was deleted
have you tried it?
That looks ai generated to me
@Clown That looks ai generated to me
I spent mins writing this by hand
@Anay-208 I spent mins writing this by hand
please add an explicit disclaimer that it is AI-generated next time, unless you have independently verified as a human that it is 100% correct.