Skip to content
Discussion options

You must be logged in to vote

Hi,

So the thing here is that, your page is being pre-rendered. That is, during build time, Next.js is trying to generate an HTML page out of your Page component.

Since you are using useSearchParams, this creates a funny situation, because Next.js can't pre-render the page, because query params, are a runtime concept (as a request comes into the server).

To your point, there are few cases where dev and build diverge. Typically, these are around optimisation, either code optimisations, or pre-rendering pages.

I am sure in time, in the future, dev time might show gotchas about the compiled page. It does in Pages Router, when getInitialProps is used in _app.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristopherChudzicki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants