Closed bestLessons closed 10 months ago
Facing this as well -> true in test environments.
I recommend you update your types to make next
optional on the window to avoid such errors in future: https://github.com/47ng/nuqs/blob/f9c89d34101945a9fc7f34acbe121ab756545549/packages/nuqs/src/update-queue.ts#L122
Thanks, I had fixed it in a previous place but this one slipped through. Types updated, marked as optional, and release baking in the oven.
:tada: This issue has been resolved in version 1.15.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Context
What's your version of
nuqs
?"nuqs": "^1.15.3",
next@13.5.6
Are you using:
basePath
option in your Next.js configwindowHistorySupport
flag in your Next.js configDescription
While running storybook
useQueryState
has a linewindow.next.version !== '14.0.3'
-> which assumes that there is a globalnext
variable inside storybook. But it doesn't exist.I think it'd be better to add something like
window.next?.version
just to make it work by defaultReproduction
Steps to reproduce the behavior:
import { useQueryState } from 'nuqs';
and it will fail to render