Skip to content

fix(ci): run codegen/build explicitly for vercel deploys under pnpm 11#3548

Merged
segunadebayo merged 2 commits into
mainfrom
fix/pnpm11-vercel-codegen
May 23, 2026
Merged

fix(ci): run codegen/build explicitly for vercel deploys under pnpm 11#3548
segunadebayo merged 2 commits into
mainfrom
fix/pnpm11-vercel-codegen

Conversation

@segunadebayo
Copy link
Copy Markdown
Member

Problem

Under pnpm 11, the install-time root prepare (husky && pnpm build-fast) no longer fires reliably on Vercel, so each deploy hit a missing build artifact:

  • website: Module not found: Can't resolve '@/styled-system/css' / '@/styled-system/patterns'styled-system/ (gitignored) was only generated by the prepare lifecycle, never in the build chain.
  • playground: same @/styled-system/* resolution failure (plus the Prisma client was also stranded in prepare).
  • studio: Cannot find module './dist/cli-default.js'packages/cli was never built, so node ../cli/bin.js codegen threw MODULE_NOT_FOUND.

Fix

Move each build prerequisite out of the fragile prepare lifecycle and into an explicit pre<script> hook, which pnpm always runs immediately before a directly-invoked script regardless of pnpm version or workspace-root quirks:

Target Change
website/package.json prebuild now ends with && panda codegen
playground/package.json added prebuild → builds packages + db:generate + css:codegen
package.json (root) added predeploy-studio: "pnpm build-fast"

prepare scripts are left intact for local-dev convenience; they're just no longer load-bearing for the Vercel builds.

Verification

Each failure was reproduced locally first, then confirmed green:

  • website — wiped styled-system/, prebuild regenerated css + patterns (exit 0)
  • playground — wiped styled-system/, prebuild regenerated Prisma client + css + patterns (exit 0)
  • studio — wiped packages/cli/dist (reproduced MODULE_NOT_FOUND), predeploy-studio rebuilt dist/cli-default.js, and prepare-studio codegen succeeded (exit 0)

No changeset — all three are private (non-published) workspace packages.

🤖 Generated with Claude Code

segunadebayo and others added 2 commits May 23, 2026 15:49
pnpm 11 no longer fires the install-time root `prepare` (build-fast) on
Vercel, so each deploy hit a missing artifact. Move the build
prerequisites into explicit `pre<script>` hooks instead of relying on the
lifecycle:

- website: prebuild now runs `panda codegen` (generates styled-system)
- playground: add prebuild to build packages + db:generate + css:codegen
- studio: add predeploy-studio to build packages so cli/dist exists before
  `node ../cli/bin.js codegen`

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 23, 2026

🦋 Changeset detected

Latest commit: ea6ecda

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@pandacss/node Patch
@pandacss/astro-plugin-studio Patch
@pandacss/dev Patch
@pandacss/mcp Patch
@pandacss/postcss Patch
@pandacss/studio Patch
@pandacss/config Patch
@pandacss/core Patch
@pandacss/extractor Patch
@pandacss/generator Patch
@pandacss/is-valid-prop Patch
@pandacss/logger Patch
@pandacss/parser Patch
@pandacss/plugin-lightningcss Patch
@pandacss/plugin-svelte Patch
@pandacss/plugin-vue Patch
@pandacss/preset-atlaskit Patch
@pandacss/preset-base Patch
@pandacss/preset-open-props Patch
@pandacss/preset-panda Patch
@pandacss/reporter Patch
@pandacss/shared Patch
@pandacss/token-dictionary Patch
@pandacss/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
panda-docs Building Building Preview May 23, 2026 2:04pm
panda-playground Building Building Preview May 23, 2026 2:04pm
panda-studio Ready Ready Preview May 23, 2026 2:04pm

Request Review

@segunadebayo segunadebayo merged commit bd2f0a1 into main May 23, 2026
5 of 7 checks passed
@segunadebayo segunadebayo deleted the fix/pnpm11-vercel-codegen branch May 23, 2026 14:06
segunadebayo added a commit that referenced this pull request May 23, 2026
#3548)

* fix(builder): prevent re-polyfilling of user's layer order declaration when polyfill is enabled

* fix(ci): run codegen/build explicitly for vercel deploys under pnpm 11

pnpm 11 no longer fires the install-time root `prepare` (build-fast) on
Vercel, so each deploy hit a missing artifact. Move the build
prerequisites into explicit `pre<script>` hooks instead of relying on the
lifecycle:

- website: prebuild now runs `panda codegen` (generates styled-system)
- playground: add prebuild to build packages + db:generate + css:codegen
- studio: add predeploy-studio to build packages so cli/dist exists before
  `node ../cli/bin.js codegen`
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.

1 participant