Shopware: Properties undefined (reading 'search')

This error can happen when you forget to inject the repositoryFactory and include the relevant repository as a computed property.

25 views
d

By. Jacob

Edited: 2023-10-16 09:48

An error was captured in current module: TypeError: Cannot read properties of undefined (reading 'search')

This can happen because you have not included the relevant repository as a computed property. E.g:

inject: ['repositoryFactory'],
mixins: [
  'cms-element'
],
computed: {
  mediaRepository() {
    return this.repositoryFactory.create('media');
  }
},

Tell us what you think: