Skip to content

Build: Run yarn dedupe after sandbox install - #35793

Merged
ndelangen merged 2 commits into
nextfrom
fix/react-latest-vitest-ci
Aug 7, 2026
Merged

ndelangen merged 2 commits into
nextfrom
fix/react-latest-vitest-ci

Conversation

@ndelangen

@ndelangen ndelangen commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Closes #

What I did

react-latest--vite---typescript---vitest went red on next after #35790 kept the published before-storybook lockfile. The failing log shows nested React under @storybook/addon-docs (Invalid hook call), not act-environment warnings.

This PR tries the least invasive fix: after every sandbox’s final yarn install, run yarn dedupe so Yarn can collapse nested copies before vitest/e2e/etc.

No new resolutions entries. Applies to all sandboxes, not only React.

If CI still fails, we can fall back to pinning react / react-dom resolutions (as nextjs sandboxes already do).

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Covered by sandbox vitest jobs under ci:daily / ci:merged, especially react-latest--vite---typescript---vitest.

Manual testing

  1. yarn task sandbox --template react-vite/default-ts --no-link --debug
  2. In the sandbox: find node_modules -path '*/react/package.json' | sort
  3. Prefer a single React (no nest under @storybook/addon-docs)
  4. yarn task vitest-integration --template react-vite/default-ts --no-link -s vitest-integration

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

@ndelangen ndelangen added bug ci:daily Run the CI jobs that normally run in the daily job. qa:skip Pull Requests that do not need any QA. (e.g. documentation) labels Aug 7, 2026
@ndelangen ndelangen self-assigned this Aug 7, 2026
@storybook-app-bot

storybook-app-bot Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Package Benchmarks

Commit: dd06496, ran on 7 August 2026 at 12:21:34 UTC

No significant changes detected, all good. 👏

@ndelangen
ndelangen force-pushed the fix/react-latest-vitest-ci branch from 736aeae to 41b9351 Compare August 7, 2026 11:25
@ndelangen ndelangen changed the title React: Fix act environment leak breaking react-latest vitest CI Build: Deduplicate React in react-vite and tanstack sandboxes Aug 7, 2026
@ndelangen ndelangen added build Internal-facing build tooling & test updates and removed bug labels Aug 7, 2026
@ndelangen

Copy link
Copy Markdown
Member Author

Research follow-up

The earlier act-compat diagnosis was wrong for this CI failure. CircleCI job 1858884 shows nested React under @storybook/addon-docs and zero act(async) without await warnings.

The branch has been force-pushed to the resolutions fix instead. #34708 / act-compat remains a separate issue if we still want that fix later.

@ndelangen ndelangen closed this Aug 7, 2026
@ndelangen ndelangen reopened this Aug 7, 2026
@ndelangen ndelangen changed the title Build: Deduplicate React in react-vite and tanstack sandboxes Build: Run yarn dedupe after sandbox install Aug 7, 2026
@ndelangen

Copy link
Copy Markdown
Member Author

Updated: dropped the resolutions approach. The PR now only runs yarn dedupe after the final install for every sandbox. Report back from CI whether that collapses the nested React under @storybook/addon-docs.

After #35790 keeps the before-storybook lockfile, the post-init tree can
leave nested copies of shared packages (e.g. react under addon-docs).
Run `yarn dedupe` for every sandbox after the final install so Yarn can
collapse those before vitest and other tasks run.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ndelangen
ndelangen force-pushed the fix/react-latest-vitest-ci branch from 15ea946 to 3bc142b Compare August 7, 2026 11:36
@ndelangen
ndelangen marked this pull request as ready for review August 7, 2026 12:10
Copilot AI review requested due to automatic review settings August 7, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c5d8cda9-934e-4efd-846a-2d7a4f980885

📥 Commits

Reviewing files that changed from the base of the PR and between 700765b and dd06496.

📒 Files selected for processing (1)
  • scripts/tasks/sandbox.ts

Walkthrough

The sandbox task now runs yarn dedupe after dependency installation and before migrations. The command uses sandbox context, dry-run/debug options, and explicit progress and error messages.

Changes

Sandbox dependency flow

Layer / File(s) Summary
Deduplicate sandbox dependencies
scripts/tasks/sandbox.ts
The task imports exec and runs yarn dedupe in the sandbox after reinstalling dependencies and before migrations. It passes dry-run/debug options and reports progress or failure.

Possibly related PRs

  • storybookjs/storybook#35790: This PR also changes sandbox Yarn installation and lockfile management around the new deduplication step.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@ndelangen
ndelangen merged commit 0e2604b into next Aug 7, 2026
297 of 300 checks passed
@ndelangen
ndelangen deleted the fix/react-latest-vitest-ci branch August 7, 2026 13:03
@github-actions github-actions Bot mentioned this pull request Aug 7, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:daily Run the CI jobs that normally run in the daily job. qa:skip Pull Requests that do not need any QA. (e.g. documentation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants