Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  3. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

TypeError: game.GameManagerSystem is not a constructor

Discussion in 'Project Tiny' started by UniversalCreative, May 16, 2019.

  1. UniversalCreative

    UniversalCreative

    Joined:
    Apr 4, 2019
    Posts:
    9
    I am able to run my game fine from my local host, but when I build it and launch index.html, I get the error:

    TypeError: game.GameManagerSystem is not a constructor

    It is from line 32 in main.js:

    game.GameManagerSystemJS.update = new game.GameManagerSystem()._MakeSystemFn();

    I cannot figure out what is causing this. Does anyone have some insight?
     
  2. Rupture13

    Rupture13

    Joined:
    Apr 12, 2016
    Posts:
    131
    Don't know much about it and haven't encountered this error, but two things I would try if I were you:
    • Check if GameManagerSystem inherits (extends) ut.ComponentSystem

    • Check the project's modules (enable all modules just to test if it works, and then disable the ones you don't need one by one).
    Besides that, a last resort backup option would be to create a new project and import all your components, systems and stuff and then hope it works again.
     
  3. UniversalCreative

    UniversalCreative

    Joined:
    Apr 4, 2019
    Posts:
    9
    Thank you.

    It does inherit from ut.ComponentSystem.

    Check my project's modules? What does that mean?
     
  4. reallyhexln

    reallyhexln

    Joined:
    Jun 18, 2018
    Posts:
    69
    UPD: oh, sorry, I get the real context.

    The first question - where you get the listing of the main.js file? As I know when you do release build there is no main.js file.
    Do you try to clear browser cache?

    If so, please check the existence of .map file in the folder where index.html placed. Please remove this file then relaunch your game again and post the code that is going before the line where throws exception.
     
    Last edited: May 17, 2019
  5. UniversalCreative

    UniversalCreative

    Joined:
    Apr 4, 2019
    Posts:
    9

    I am not sure the difference between release build and any other build. The only build option I see is "Build". (Alternatively, to press play via the editor.)

    There is a local host I can launch from that is created when I build, and that works correctly.

    I guess my main objective is to be able to take the created build and drop it on a website. Perhaps I am building incorrectly?

    I see no .map file. The main.js is autogenerated when I build.

    What steps should I take when I make a build?

    (PS, thank you for your help.)
     
  6. UniversalCreative

    UniversalCreative

    Joined:
    Apr 4, 2019
    Posts:
    9
    I am very blind. I never clicked on the .utproject. There are all sorts of options in there. Thanks :)
     
    reallyhexln likes this.
  7. reallyhexln

    reallyhexln

    Joined:
    Jun 18, 2018
    Posts:
    69
    Yes, you're right. "Debug" and "Development" versions of the game require started web server on your target machine.
    Release version is fully standalone and portable, so it don't require any web servers and may be just opened in the browser with index.js file.