Skip to content

[Bug]: Next.js Link component causes navigation to a non-existent page in stories #30390

Open
@Ronny-zzl

Description

@Ronny-zzl

Describe the bug

When using the Link component from Next.js 15 within an appDirectory configuration, the component behavior is not properly overridden. This leads to navigating directly to nonexistent pages after clicking the link.

This behavior does not occur with Next.js 14.

Reproduction link

https://stackblitz.com/edit/github-6hzs76ok?file=src%2Fstories%2FHeader.tsx

Reproduction steps

  1. Go to the above link
  2. Go to a story of the Header component
  3. Click the link on the header, and the preview will crush

System

Storybook Environment Info:

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm <----- active
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @storybook/addon-essentials: ^8.6.0-alpha.2 => 8.6.0-alpha.2 
    @storybook/addon-interactions: ^8.6.0-alpha.2 => 8.6.0-alpha.2 
    @storybook/addon-onboarding: ^8.6.0-alpha.2 => 8.6.0-alpha.2 
    @storybook/blocks: ^8.6.0-alpha.2 => 8.6.0-alpha.2 
    @storybook/nextjs: ^8.6.0-alpha.2 => 8.6.0-alpha.2 
    @storybook/react: ^8.6.0-alpha.2 => 8.6.0-alpha.2 
    @storybook/test: ^8.6.0-alpha.2 => 8.6.0-alpha.2 
    storybook: ^8.6.0-alpha.2 => 8.6.0-alpha.2

Additional context

Proper behavior with Next.js 14

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions