Skip to content

Bug: mount makes props deeply reactive #2949

Closed

Description

@ackwell

Describe the bug

Non-reactive props passed to mount are made deeply reactive, which does not match runtime vue behavior.

This is most noticeable when passing a Component as a prop. The resulting reactivity triggers the vue "Component that was made a reactive object" warning when attempting to render the provided component.


For the example reproduction, compare the running vue application from npm run dev to the output of tests from npm run test:unit.

Apologies for the GH link rather thank stackblitz, the latter isn't playing ball for me right now.

Reproduction

https://github.com/ackwell/reproductions/tree/vue-test-utils-mount-prop-reactivity

Expected behavior

  • isReactive to return false, as it does in non-test environments
  • No warning from vue when running the test

Environment

  System:
    OS: macOS 27.0
    CPU: (12) arm64 Apple M4 Pro
    Memory: 74.16 MB / 24.00 GB
    Shell: 4.7.1 - /opt/homebrew/bin/fish
  npmPackages:
    @vue/test-utils: ^2.5.0 => 2.5.1
    vitest: ^4.1.11 => 4.1.11
    vue: ^3.5.42 => 3.5.43

Additional context

No response

Activity

  1. added theissue type on Sep 23, 2026
  2. added
    bug
    on Sep 23, 2026
  3. cexbrayat commented on Sep 23, 2026

    @cexbrayat
    Member

    Hi @ackwell

    Thank you for your detailed repro. This is indeed looks like something we could fix.
    I suppose we could use shallowReactive() for the root prop container. This would track top-level replacements made by setProps at without converting property values into proxies.

    Feel free to open a PR, we would gladly review and merge it!

  4. ackwell commented on Sep 24, 2026

    @ackwell
    ContributorAuthor

    Thanks! Have done, ref. #2951.

    As I've outlined in the PR's description, this breaks an existing test introduced in light of #1476, which I suspect has been enforcing incorrect semantic behavior since its addition.

    I've extended my reproduction with an example of that report, showing that as-is it is broken in runtime environments without reactive wrapping. ref ackwell/reproductions@692eaf7

  5. added a commit that references this issue on Oct 22, 2026
    daf3541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions