No announcement yet.

[OPEN] [#2306] Cannot read property of undefined

  • Filter
  • Time
  • Show
Clear All
new posts

    [OPEN] [#2306] Cannot read property of undefined

    Hello, I've started with few weeks ago. I was trying to create some simple program to see if it works, but there's a problem.

    I have folder Logic with some .cs files with classes, but I can't access them. Here's a screenshot:

    When I try to call any method, create new instance of it, or anything other, I receive this exception. How can I fix it? Here's screenshot of folder in VS Solution Explorer:

    Last edited by geoffrey.mcgill; 2017-01-29 @ 04:55 PM.


    We need test sample which reproduces the issue
    For example, you can upload your project to some public git repository and we will review it


      Or better yet, a link to a Deck that demonstrates how to reproduce the error.


        Here's link to Git:

        The problem causes App.cs, method Main(), lines 14 & 15.


          Is it because you are not including the_Black_Hunt.bridge.logic.js in your .html page?

          Can you simplify your sample down to just the minimum amount of code required to reproduce the problem? When I simplify, and include the_Black_Hunt.bridge.logic.js, the page runs as expected.


            Might also be an issue with your Assembly name. You should remove the spaces, or replace with dots.

            Recommended Naming Convention:

            Click image for larger version

Name:	Screenshot 2017-01-29 13.38.22.png
Views:	1
Size:	16.5 KB
ID:	3389

            Hope this helps.


              I suggest to use combineScripts option in bridge.json (see
              In this case, Bridge will combine all scripts to one file (including bridge.js)


                I've added a new version of my project to Git. The 'Cannot read property of undefined' is fixed (thank you!), but there are 2 more exceptions:

                - Uncaught SyntaxError: Unexpected identifier (The Black Hunt.bridge.logic.js (3240))
                - Uncaught TypeError: Cannot read property 'Logic' of undefined at $main (the Black Hunt.js (91))

                First exception (at javascript file the_Black_Hunt.bridge.logic.js):

                Second exception (C# file App.cs, method Main):
                new Weapon("", "", 0, 0, 0, 0, 0);


                  The problem occurs because you use Bridge as part of your namespace, for example `The_Black_Hunt.Bridge.Logic`. It forces errors of bridge resolving system. I suggest do not use `Bridge` as entity name or part of namespace. So, to resolve the the issue just remove Bridge from namespace everywhere

                  We will try to fix such issues in the next releases
                  Git issue has been opened:


                    It works, thanks! I've moved the Logic folder outside Bridge folder and it works now! Thanks :-)
                    Last edited by geoffrey.mcgill; 2017-02-13 @ 07:39 PM.