`vercel build` ignores the project's framework preset when writing config.json, so the Vercel Toolbar is never added to a Storybook build in a repo that depends on next
What happens
We deploy only the Storybook build (storybook build → storybook-static) from a repo whose package.json also depends on next. Preview feedback is on at the team and project level, and every deployment reports previewCommentsEnabled: true, but the Vercel Toolbar never appears on any preview.
Why
getFramework() in internals/cli-builder-integration/src/do-build.ts runs detectFrameworkRecord() against the repo root with the full frameworkList. It never looks at the project's framework setting or vercel.json#framework. Because next is a dependency, .vercel/output/config.json always ends up with:
"framework": { "slug": "nextjs", "version": "16.3.6" }This happens whether the project preset is storybook, Other (null), or framework: null in vercel.json, and even when the build command writes .vercel/output itself.
For Next.js, the toolbar is loaded by a snippet appended to the webpack runtime chunk, so Vercel does not add the feedback.js script to HTML responses. A Storybook or other static build has no webpack runtime, so it gets no toolbar at all.
Repro
- A repo with
nextindependenciesand Storybook. - Project preset
storybook(or Other), build commandstorybook build, output directorystorybook-static. - Run
vercel buildand check.vercel/output/config.json:framework.slugisnextjs. - Deploy a preview: the HTML has no
<script ... src="https://vercel.live/_next-live/feedback/feedback.js">. - Delete
frameworkfromconfig.jsonand runvercel deploy --prebuilt: the script is appended to every HTML page and the toolbar shows up.
Expected
When the project, or vercel.json, sets a framework, getFramework() should use it instead of the framework detected from the repo root, or at least not report a framework whose builder didn't run. Alternatively, only skip adding the toolbar to HTML when the Next.js builder actually produced the output.
Workaround
Remove next from package.json in the build container after the build, so the framework is detected as something else (confirmed: the toolbar then appears on previews):
"buildCommand": "storybook build && npm pkg delete dependencies.next"Vercel CLI 59.25.4 (build image); I also reproduced it locally with 54.2.0.
Source: vercel/vercel