You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next.js information (obtained by running next info):
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:59 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6030
Available memory (MB): 36864
Available CPU cores: 11
Binaries:
Node: 20.11.1
npm: 10.2.4
Yarn: 1.18.0
pnpm: N/A
Relevant Packages:
next: 14.2.11 // There is a newer version (14.2.12) available, upgrade recommended!
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.5.4
Next.js Config:
output: N/A
⚠ There is a newer version (14.2.12) available, upgrade recommended!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
Are you using:
✅ The app router
❌ The pages router
❌ The basePath option in your Next.js config
❌ The experimental windowHistorySupport flag in your Next.js config
Description
The clearOnDefault option does not seem to work when using createSerializer. Seeing as TS was happy I expected it to work. I love this feature from the hooks so would be amazing getting it to work!
Let me know if I should attempt adding/fixing this and I'll take a stab at it :)
Reproduction
I skipped creating a CodeSandbox playground since it's very easy to explain. Let me know if I still should create one 😄
constserialize=createSerializer({int: parseAsInteger.withOptions({clearOnDefault: true}).withDefault(0)})constresult=serialize({int: 0})// ^ Result is `?int=0`
The text was updated successfully, but these errors were encountered:
Ah yes, that would make sense for the serializer to follow this setting. If you want to open a PR, that'd be great, thanks!
Awesome! I've opened #642 where I seem to have fixed it, but haven't figured out how to type it properly yet so it has some @ts-expect-error directives. Can continue looking into it when I have some more time!
Context
What's your version of
nuqs
?Next.js information (obtained by running
next info
):Are you using:
basePath
option in your Next.js configwindowHistorySupport
flag in your Next.js configDescription
The
clearOnDefault
option does not seem to work when usingcreateSerializer
. Seeing as TS was happy I expected it to work. I love this feature from the hooks so would be amazing getting it to work!Let me know if I should attempt adding/fixing this and I'll take a stab at it :)
Reproduction
I skipped creating a CodeSandbox playground since it's very easy to explain. Let me know if I still should create one 😄
The text was updated successfully, but these errors were encountered: