Magento – SyntaxError: missing ) after argument list

cacheerrorjavascriptmagento2

I have encountered a weird error, after some time of development and clearing cache I am getting the following error.

SyntaxError: missing ) after argument list

I have created several modules and start getting this error, after clearing cache.

The line where error is occurred.

            setText(el, "'"
    .addAttribute('translate', {
        binding: 'i18n'
    });

Also this error occurs in other files.

How can I solve this problem ?

Best Answer

Try to set Stores -> Configuration -> Advanced -> Developer -> JavaScript Settings -> Translation Strategy option to value "Dictionary (Translation on Storefront side)"

..or use that query:

UPDATE `core_config_data` SET `value` = 'dictionary' WHERE `core_config_data`.`path` = 'dev/js/translate_strategy' LIMIT 1;
Related Topic