1

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 ?

1
  • You,need to correct ypur code wth setText(el, "'" .addAttribute('translate', { binding: 'i18n' }); share full console log and file path, also try this command php -dmemory_limit=5G setup:static:deploy { add your local code here like 'nl_NL' } -f – kunj Jun 9 '18 at 3:12
2

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;
2
  • Along this line, when locked out of the admin menu due to this javascript syntax error, I found that this also works: php bin/magento config:set dev/js/translate_strategy dictionary, which does the same thing. – Tom Anderson Jul 21 '19 at 8:21
  • I did this along with turning off (0) javascript configs : dev/js/merge_files dev/js/enable_js_bundling dev/js/minify_files dev/js/move_script_to_bottom – Barry Oct 8 '19 at 13:31
1

Use this code:

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

You have not closed ')' while you have opened 2 '(' and closed 1. Please check your code.

3
  • I haven't modify any JS file, this error appeared instantly, there more files that have that problem and I didn't touch them – solderingiron Jun 8 '18 at 18:15
  • Did you any extension recently? – Sukumar Gorai Jun 8 '18 at 19:06
  • 1
    I have disabled all custom modules, but still have the same issue – solderingiron Jun 8 '18 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.