vuejs / vue-jest

Jest Vue transformer
MIT License
748 stars 156 forks source link

`Cannot read properties of undefined (reading 'extend')` when using `@vue/vue2` with jest projects -- works with legacy `vue-jest` #511

Open fjaeger opened 2 years ago

fjaeger commented 2 years ago

We have a monorepo and use jest projects (https://jestjs.io/docs/configuration#projects-arraystring--projectconfig). Each project comes with its own jest.config.js file. When running yarn jest from the monorepo's root, Vue test files fail with Cannot read properties of undefined (reading 'extend'). When first navigating into the subdirectory and running yarn jest from there, the tests pass successfully.

When replacing @vue/vue2 as the transformer for vue files with the legacy vue-jest the same tests also pass when jest is launched from the monorepo root.