• Resolved christer_f

    (@christer_f)


    Hi Aakash,

    Today I updated your plugin on a site from version 6.4 to 7.0 and I’m now getting Javascript errors from wp-socializer.min.js. I switched to the non-minified version and found that the error appears on line 486. Error message:

    “SyntaxError: Invalid regular expression: invalid group specifier name”

    Then I put single quotes around the regular expression, and the error message goes away (but maybe this may cause other problems??)

    — christer

    • This topic was modified 2 years, 5 months ago by christer_f.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi Christer,

    Thanks for checking. Looking at the error I guess it is something specific to safari browser.

    Can you please check once in Chrome and share your website URL where error is observed ?
    I would like to see the issue live.

    Thanks,
    Aakash

    Thread Starter christer_f

    (@christer_f)

    Thanks for your very quick reply!

    No problem in Chrome!

    I did the update on my local development system (I always do that before doing updates to a production environment), which is not accessible from the outside. I don’t want to update the production environment now since a Javascript error will impact other things, but I can copy over to a staging server. Will take some 30 minutes. I’ll send you the URL when it’s done

    Thread Starter christer_f

    (@christer_f)

    This is the URL to the staging server:

    https://aravis.chrilleferna.opalstacked.com

    I have switched to the unminified version of wp-socializer.js so you can see on which line the problem shows up

    Thread Starter christer_f

    (@christer_f)

    Hi Aakash,
    Any news on this? I quick Google search tells me that this problem is due to Safari not supporting lookbehind in javascript regular expressions. This means that even when/if Safari starts supporting lookbehind the code will break in older browsers, so better change the regex to one without lookbehind.

    Plugin Author vaakash

    (@vaakash)

    Hi @christer_f,

    I’m working on the issue. I’ll provide a workaround (i.e a code change) which you can make. Once I’m done testing I’ll share it with you.

    Thanks,
    Aakash

    Plugin Author vaakash

    (@vaakash)

    Hi @christer_f,

    Please find the modified code below.
    https://pastebin.com/bg8sFeey

    Copy and paste it to wp-socializer/public/js/wp-socializer.js
    Refresh browser/cdn cache if required.

    This is not the the minified version. For now please continue with this. I’ll cover this issue as a part of the next release by next month mid.

    Thanks,
    Aakash

    Thread Starter christer_f

    (@christer_f)

    Hi Aakash,

    Works fine!

    Thanks you SO much for your quick and accurate fix.

    Cheers,
    — christer

    Plugin Author vaakash

    (@vaakash)

    Cheers !

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Javascript syntax error in version 7.0’ is closed to new replies.