Vuex_Fundamentals icon indicating copy to clipboard operation
Vuex_Fundamentals copied to clipboard

TypeError: 'set' on proxy: trap returned falsish for property 'hasOwnProperty'

Open KengoWada opened this issue 3 years ago • 2 comments

I keep trying to mount the component for real world testing L2 start but I keep getting this error

> [email protected] test:unit
> vue-cli-service test:unit

 FAIL  tests/unit/EventCard.spec.js
  EventCard
    ✕ renders the event's data successfully (16ms)

  ● EventCard › renders the event's data successfully

    TypeError: 'set' on proxy: trap returned falsish for property 'hasOwnProperty'

      11 |     }
      12 | 
    > 13 |     mount(EventCard, { props: { event } })
         |     ^
      14 |   })
      15 | })
      16 | 

      at mount (node_modules/@vue/test-utils/dist/vue-test-utils.cjs.js:7838:24)
      at Object.<anonymous> (tests/unit/EventCard.spec.js:13:5)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        1.157s, estimated 2s
Ran all test suites.

KengoWada avatar Jul 11 '21 05:07 KengoWada

Hi @KengoWada, I had the same issue and resolved it by bumping vue to 2.0.6. This seemed to be a common issue with prior versions and vue-test-utils.

onydra avatar Jul 07 '22 11:07 onydra

I've came across the same issue but I had to update to 3.0.6 according to

  • vuejs/test-utils/issues/439

Steps to fix:

  1. Replace "vue": "^3.0.0-0", with "vue": "^3.0.6",
  2. Run npm install

My dependencies in package.json now look like this.

  "dependencies": {
    "core-js": "^3.6.5",
    "uuid": "^8.3.2",
    "vue": "^3.0.6",
    "vue-router": "^4.0.0-0",
    "vuex": "^4.0.0-0"
  },

Makoehle avatar Jul 31 '22 14:07 Makoehle