-
Context"next": "14.2.22",
"nuqs": "^2.2.3", Problem DescriptionCurrently, nuqs uses To address this, I found that opting out of shallow routing resolves the conflict (https://github.com/47ng/nuqs/blob/next/packages/nuqs/src/adapters/next/impl.app.ts#L35-L40). However, specifying Reproductioncodesandbox Proposed SolutionIntroduce a global configuration option in nuqs that allows developers to opt-in or opt-out of shallow routing. This would enable teams to globally disable shallow routing without needing to explicitly specify Benefits
Cloudflare Zaraz Code for
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Thanks for the report. It might be possible to export the same That being said, the issue should be raised with Zaraz and/or Next.js, because Zaraz breaks a core behaviour of Next.js, whether using nuqs or not. A global option context provider was discussed at some point, but I feel like addressing the heart of the problem is more relevant. There may be other tools out there patching the history methods (I remember Plausible analytics did have some issues when Next.js broke their own history patch). I really wish the browser had a native event for History changes (popstate doesn't trigger for |
Beta Was this translation helpful? Give feedback.
Thanks for the report.
nuqs@^1
did also patch the history methods, and so seems to work with your reproduction. If you are able in your project, can you try and install that version (1.20.0
is the latest in the^1
line) and see if it works better? Note that there is no adapters in nuqs 1, so you'll have to remove it from your layout.tsx.It might be possible to export the same
enableHistorySync
helper in Next.js that we need in React Router (and is optional in the React SPA adapter), to opt-in to patch the history methods and keep the same level of features (ie: not being stuck withshallow: false
).That being said, the issue should be raised with Zaraz and/or Next.js, because Zaraz break…