Zend certified PHP/Magento developer

Requirejs mapping not working

There seems to be an issue with a module I have called Aheadworks AutoRelatedProducts.
Basically, the requirejs section looks like this:

map: {
        '*': {
            'awArpGrid': 'Aheadworks_Autorelated/js/aw-arp-grid',
            'awArpSlider': 'Aheadworks_Autorelated/js/aw-arp-slider',
            'awArpSendClickStatistics': 'Aheadworks_Autorelated/js/aw-arp-send-click-statistics',
            'awArpAjax': 'Aheadworks_Autorelated/js/aw-arp-ajax'
        }
    },

So for example, the awArpSlider alias does not work when referenced, e.g that is referenced in a method like this:

public function getDataMageInitForBlock($arpBlock)
    {
        return $this->isGridTemplate($arpBlock->getRule()->getTemplateId())
            ? '{"awArpGrid": {"rows": "' . $arpBlock->getRule()->getGridRow() . '"}}'
            : '{"awArpSlider": {"slides": ' . $this->prepareMaxSlidesToDisplay($arpBlock) . '}}';
    }

but on the frontend, I get the following error in the console, saying it can’t find the file, as it seems to be looking in the wrong location:

https://marco.test/static/frontend/Marco/Excel3/en_GB/awArpSlider.js net::ERR_ABORTED 404
Error: Script error for: awArpSlider

To “fix” this, I can change the code in the method, to use the actual path instead of the alias name, it becomes:

public function getDataMageInitForBlock($arpBlock)
    {
        return $this->isGridTemplate($arpBlock->getRule()->getTemplateId())
            ? '{"awArpGrid": {"rows": "' . $arpBlock->getRule()->getGridRow() . '"}}'
            : '{"Aheadworks_Autorelated/js/aw-arp-slider": {"slides": ' . $this->prepareMaxSlidesToDisplay($arpBlock) . '}}';
    }

after reloading the page, the error is gone and the slider is working!

However, I’d rather not have to edit the actual vendor files to fix this so I’d just like to understand why is this happening, and is there a more efficient way to fix it opposed to what I have done so far please? 🙂

Cheers