Jump to content

Facebook Instant Game won't load Babylonjs


DylanD
 Share

Recommended Posts

Hello again everyone,

 

I am trying to get my Facebook instant game to production, but when I try to load the game, it never loads, and gives me this error:

[Error] Failed to load resource: the server responded with a status of 404 () (babylon.js, line 0)

[Error] TypeError: Prototype value can only be an object or null
    setPrototypeOf (babylon.gui.js:25:257)
    (anonymous function) (babylon.gui.js:25:257)
    (anonymous function) (babylon.gui.js:33)
    (anonymous function) (babylon.gui.js:561)
    (anonymous function) (babylon.gui.js:563)
    (anonymous function) (babylon.gui.js:564)
    universalModuleDefinition (babylon.gui.js:19)
    Global Code (babylon.gui.js:21)

 

@Temechon

 

This same project works as a web app and loads properly.  Its only when I build and upload to Facebook that it can no longer load babylon (or anything for that matter).

I don't know why it can't find the files.  They are located here:  ./node_modules/babylonjs/babylon.js

so I don't know why Facebook won't load them.

this is how my index.html looks:

<!DOCTYPE html>
<head>
  <link rel="stylesheet" type="text/css" href="css/style.css" />
  
  <script src="node_modules/babylonjs/babylon.js"></script>
  
  <script src="node_modules/babylonjs-gui/babylon.gui.js"></script>
  <script src="node_modules/babylonjs-materials/babylonjs.materials.js"></script>

  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  
    <script src="node_modules/systemjs/dist/system.src.js"></script>
   
    <script src="js/systemjs.config.js"></script>
    
    
    <script>
      System.import('app').then(function() {
         
          console.log('Imported');
            
          
      }).catch(function(err){ 
          console.error(err); 
        });
    </script>
    <script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>
</head>
<body>
    
    <canvas id="renderCanvas"></canvas>
    

</body>
</html>

it seems that those errors go away if I put the connect.facebook src script after everything but then it gives me this error:

[Error] Failed to load resource: the server responded with a status of 404 () (game.js, line 0)

Any ideas how to fix this?

Link to comment
Share on other sites

I believe it is also case sensitive....

Yea it is.

 

So it is case sensitive and you cannot start a file direction(?) with ./ or / for loading resources,  if you want to import a class or library you can use ./

 

So if you have loading problems check these:

- does your html src's use ./, if so get rid of them

-does any thing that points to a file have the exact name (upper case) and not start with ./ if not then make sure you have the exact naming, and no ./

Not exactly sure why this happens, this was just my experience.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...