Search Unity

Bug ReferenceError: _GetBrowserQueryString is not defined

Discussion in 'Web' started by oleegarch, Dec 2, 2022.

  1. oleegarch

    oleegarch

    Joined:
    Sep 26, 2022
    Posts:
    4
    I got this error in javascript console when open my WebGL Unity build. I created a folder named "Plugins" and put inside a file with .jslib extension with next code: upload_2022-12-2_19-9-49.png

    And the file has a check WebGL.
    upload_2022-12-2_19-12-11.png

    The code that uses this plugin is below:
    upload_2022-12-2_19-15-3.png
     
  2. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    288
    Unity 2021 and earlier cannot use ES6 syntax.
    Unity 2021 and earlier cannot use ES6 syntax in .jslib. So try changing
    Code (CSharp):
    1.  GetBrowserQueryString: () => {
    to
    Code (CSharp):
    1.  GetBrowserQueryString: function() {
    modify the other parts where the arrow function is used in the same way.
    .
     
  3. oleegarch

    oleegarch

    Joined:
    Sep 26, 2022
    Posts:
    4
    I already figured it out, but thanks anyway :)