47ng / 47ng/nuqs

Storybook Issues with v2

Open
#757 14 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
10.8k
Forks
294
Avg merge
1d 16h
Merged PRs (30d)
21

Description

## Context

What's your version of `nuqs`?

```
^2.1.1
```

What framework are you using?

- ✅ Next.js (app router)
- ✅ Next.js (pages router)

Which version of your framework are you using?

```
^14.2.9 and ^15.0.3 tested
```

## Description

If i try to use nuqs in Storybook i get following errors:
`import { NuqsAdapter } from "nuqs/adapters/next";`
![image](https://github.com/user-attachments/assets/60348a19-c5ef-48c3-8a2b-b5ccfb64fd31)

`import { NuqsAdapter } from "nuqs/adapters/next/pages";`
![image](https://github.com/user-attachments/assets/654267f0-ece9-45e1-957c-f54367b1e0b2)

I have not specified app router. If i use `import { NuqsAdapter } from "nuqs/adapters/react";` everything works fine.
I use the adapter inside a decorator in the preview.js file.

```
const preview = {
decorators: [
(Story) => (



),
],
};
```

My main.js includes
```
framework: {
name: "@storybook/nextjs",
options: {},
},
```

## Reproduction

Codesandbox: https://codesandbox.io/p/github/BhagirathiRohidas/storybook-nextjs/csb-w7fl7v/draft/quirky-andras
`npm run storybook`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.