I simply want to add js for my custom module but I'm getting this error:
layout.js:137 Uncaught TypeError: Constr is not a constructor
The hello.js file will still work, console.log will still work, however, I still get the error above. Any idea?
requirejs-config.js
var config = {
map: {
'*': {
emlhello : 'EML_CityAutocomplete/js/hello'
}
}};
hello.js
define([
"jquery"
], function($){
"use strict";
console.log('asdasd');
return true;
})
And I'm trying to call it via layout xml
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="autocomplete" xsi:type="array">
<item name="sortOrder" xsi:type="string">0</item>
<item name="component" xsi:type="string">EML_CityAutocomplete/js/hello</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>