Skip to content

"object is not extensible" error in Cypress 14 Vue component testing #31121

Open
@hackel

Description

@hackel

Current behavior

I'm trying to upgrade from Cypress 13.17.0 to 14.0.3, and my component tests are consistently failing with a variation of the following when trying to mount the component:

  1) <LaneSelection />
       renders:
     TypeError: Cannot define property inputMappingTable, object is not extensible
      at Function.defineProperty (<anonymous>)
      at useTemplateRef (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=3811e48f:4053:14)
      at setup (http://localhost:51730/__cypress/src/resources/assets/vue/modules/BidTool/LaneSelection.vue:128:27)
      at callWithErrorHandling (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=da819e0b:2743:19)
      at setupStatefulComponent (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=da819e0b:10463:25)
      at setupComponent (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=da819e0b:10424:36)
      at mountComponent (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=da819e0b:7780:7)
      at processComponent (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=da819e0b:7746:9)
      at patch (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=da819e0b:7262:11)
      at mountChildren (http://localhost:51730/__cypress/src/node_modules/.vite/deps/chunk-46253U5O.js?v=da819e0b:7494:7)

It appears to be related to the use of Vue's useTemplateRef function, but I didn't have this problem with the previous version of Cypress. And just to add some more fun to the mix, when I run the tests locally, eventually they start passing just fine without any code changes.

Desired behavior

Component tests should run successfully.

Test code to reproduce

https://github.com/hackel/cypress-test-tiny

Cypress Version

14.0.3

Node version

20.18.1

Operating System

Ubuntu latest / 24.04

Debug Logs

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CTIssue related to component testingstage: needs informationNot enough info to reproduce the issuev14.0.0 🐛Issue present since 14.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions