Skip to content

Comments

[WIP] Fix cacheLife export issue in storybook nextjs vite#33263

Closed
Copilot wants to merge 1 commit intonextfrom
copilot/fix-cachelife-export-issue
Closed

[WIP] Fix cacheLife export issue in storybook nextjs vite#33263
Copilot wants to merge 1 commit intonextfrom
copilot/fix-cachelife-export-issue

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: cacheLife export from next/cache not resolved in @storybook/nextjs-vite</issue_title>
<issue_description>### Describe the bug

When using @storybook/nextjs-vite, importing cacheLife from next/cache fails with:

The requested module '/node_modules/.cache/storybook/.../sb-vite/deps/next_cache.js' does not provide an export named 'cacheLife'

Reproduction link

https://github.com/ButterflyBug/storybook-nextjs-cachelife-bug

Reproduction steps

  1. Go to above link
  2. Clone the repository
  3. Install dependencies: pnpm install
  4. Run Storybook: pnpm storybook
  5. Go to http://localhost:6006/?path=/story/example-cacheddata--default

Expected behaviour

The story is rendered without errors, with cacheLife properly resolved from next/cache.

Actual behaviour

Storybook fails to load the story with the error about missing cacheLife export:

The requested module '/node_modules/.cache/storybook/.../sb-vite/deps/next_cache.js?v=5fe07202' does not provide an export named 'cacheLife'

System

Storybook Environment Info:
│

│  System:
│  OS: macOS 15.7.1
│  CPU: (8) arm64 Apple M1 Pro
│  Shell: 5.9 - /bin/zsh
│  Binaries:
│  Node: 22.14.0 - /Users/user/.nvm/versions/node/v22.14.0/bin/node
│  Yarn: 1.22.22 - /opt/homebrew/bin/yarn
│  npm: 10.9.2 - /Users/user/.nvm/versions/node/v22.14.0/bin/npm
│  pnpm: 10.6.2 - /opt/homebrew/bin/pnpm <----- active
│  Browsers:
│  Chrome: 142.0.7444.176
│  Firefox: 145.0
│  Safari: 26.0.1
│  npmPackages:
│  @storybook/nextjs-vite: ^10.2.0-alpha.1 => 10.2.0-alpha.1
│  eslint-plugin-storybook: ^10.2.0-alpha.1 => 10.2.0-alpha.1
│  storybook: ^10.2.0-alpha.1 => 10.2.0-alpha.1

Additional context

Nextjs version: 16.0.6</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: cacheLife export from next/cache not resolved in @storybook/nextjs-vite

2 participants