Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug ReferenceError: _GetBrowserQueryString is not defined

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

  1. oleegarch

    oleegarch

    Joined:
    Sep 26, 2022
    Posts:
    3
    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:
    277
    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:
    3
    I already figured it out, but thanks anyway :)