Skip to content

Error: NextRouter was not mounted. Storybook 7.0.9, NextJS 13.1.4 #144

@dacgray

Description

@dacgray

We set up storybook with these instructions: https://storybook.js.org/blog/get-started-with-storybook-and-next-js/

In these versions we set router parameters with:

const parameters = {
    nextjs: {
        router: {
            route: '/my-route',
            path: '/my-route',
            asPath: '/my-route',
            locale: 'en-GB',
        },
    },
}

const getStory = (handler: FooHandler): Story => {
    return {
        parameters,
        ...

We get Error: NextRouter was not mounted

router.js:121

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions