Skip to content

useSearchParams() should be wrapped in a suspense boundary at page "/404". #61654

Answered by odafeaggreh
aseph8083 asked this question in Help
Discussion options

You must be logged in to vote

For me, the solution to the problem was a little hard to track down because I did not have useSearchParams() anywhere in my codebase. After much debugging, I found that the problem was from using next-nprogress-bar.

What worked for me was to wrap the ProgressBar in <Suspense></Suspense>

Code:

ProgressBarProvider.js

"use client";
import { AppProgressBar as ProgressBar } from "next-nprogress-bar";
const ProgressBarProvider = ({ children }) => {
  return (
    <>
      {children}
      <ProgressBar
        height="4px"
        color="#000000"
        options={{ showSpinner: false }}
        shallowRouting
      />
    </>
  );
};

export default ProgressBarProvider;

app/layout.js

<Suspense>

Replies: 8 comments 19 replies

Comment options

You must be logged in to vote
1 reply
@aseph8083
Comment options

Comment options

You must be logged in to vote
6 replies
@deadcoder0904
Comment options

@karanj08
Comment options

@icyJoseph
Comment options

@T1rth1
Comment options

@icyJoseph
Comment options

Comment options

You must be logged in to vote
2 replies
@icyJoseph
Comment options

@immdraselkhan
Comment options

Comment options

You must be logged in to vote
8 replies
@eclipssed
Comment options

@fenggwsx
Comment options

@fenggwsx
Comment options

@Bunyod0301
Comment options

@contradeepak
Comment options

Answer selected by aseph8083
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Affaq-Ahmed
Comment options

@Lokesh01
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet