Migration to nextjs 16 blocked by deprecated import in preview.js #34937
Replies: 1 comment 1 reply
-
|
Hi @matthew-petty! I'm Dosu and I’m helping the storybook team. This was addressed in PR #32547, which conditionally excludes the However, you mentioned you're on Next.js 15 — and on Next 15 the A few things to clarify:
Could you share:
If you're on a Next 16 release candidate and the guard isn't triggering, a minimal reproduction would help track down why the version check isn't excluding the preview file. To reply, just mention @dosu. Docs are dead. Just use Dosu. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a documented fix or workaround for the use of next/config in storybook? I have read in many places that it's compatible with next 16, but it looks like this deprecation warning is still firing. We are running 10.4.1
Storybook is emitting this warning during frontend builds/dev:
Diagnosis
Our first-party code is clean —
frontend/srcandfrontend/.storybookcontain zero usages ofnext/config,publicRuntimeConfig,serverRuntimeConfig, orgetConfig. The warning comes from a dev dependency:frontend/node_modules/@storybook/nextjs-vite/dist/config/preview.js:2frontend/node_modules/vite-plugin-storybook-nextjs/dist/index.js:5046already guards a related inject list with anisNext16orNewercheck (...isNext16orNewer ? [] : ["next/config"]), so upstream is partially aware, but the preview-side import still fires unconditionally on Next 15.Beta Was this translation helpful? Give feedback.
All reactions