# Shopware Komponente erweitern TypeError: message.split is not a function

**URL:** https://forum.shopware.com/t/shopware-komponente-erweitern-typeerror-message-split-is-not-a-function/67194
**Category:** Programmierung
**Created:** [25. Mai 2020 um 20:44 UTC](https://forum.shopware.com/t/shopware-komponente-erweitern-typeerror-message-split-is-not-a-function/67194 "2020-05-25T20:44:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![antoni\_ku](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@antoni\_ku](https://forum.shopware.com/u/antoni_ku)
#### Post date: [25. Mai 2020 um 20:44 UTC](https://forum.shopware.com/t/shopware-komponente-erweitern-typeerror-message-split-is-not-a-function/67194/1 "2020-05-25T20:44:15Z")

</div>

Schreibe gerade an einem Plugin und erhalte folgende Fehlermeldung in der Console `TypeError: message.split is not a function found in <swproductmediaform>...`

Die Komponente wird von mir überschrieben und um eine Funktion erweitert.

```
import template from './sw-product-media-form.html.twig';

const { Component } = Shopware;

Component.override('sw-product-media-form', {
    template,
    computed: {
        hoverCover() {
            if (!this.product) {
                return null;
            }
            return this.product.media.find(media => media.id === this.product.hoverCoverId);
        },

        currentHoverCoverID() {
            const hoverCoverMediaItem = this.productMedia.find(hoverCoverMedium =>
                hoverCoverMedium.media.id === this.product.hoverCoverId
            );

            return hoverCoverMediaItem.id || null;
        }
    },
    methods: {
        createPlaceholderMedia(mediaItems) {
            return {
                ...this.$super('createPlaceholderMedia'),
                isHoverCover: false,
            };
        },

        removeHoverCover() {
            this.product.hoverCoverId = null;
        },

        isHoverCover(productMedia) {
            if (this.product.media.length === 0) {
                return false;
            }

            return productMedia.id === this.product.hoverCoverId;
        },

        removeFile(productMedia) {
            // remove cover id if mediaId matches
            if (this.product.coverId === productMedia.id) {
                this.product.coverId = null;
            }
            
            // remove hover cover id if mediaId matches
            if (this.product.hoverCoverId === productMedia.id) {
                this.product.hoverCoverId = null;
            }

            this.product.media.remove(productMedia.id);
        },

        markMediaAsHoverCover(productMedia) {
            this.product.hoverCoverId = (productMedia.productMediaId || productMedia.id);
            this.productFromStore.hoverCoverId = (productMedia.productMediaId || productMedia.id);
        },
    }
});

{% block sw_product_media_form_grid_items %}
    
    
{% endblock %}

```

Hab alles mögliche schon geprüft und kann den Fehler nicht finden.
