For some reason when I manually load the api either from a web host, or locally, I keep getting this error.
Code: Select all
Uncaught ReferenceError: SFS2X is not defined.
I have triple-checked that the file is indeed being loaded. I don't know if this is a SmartFox issue or not because I know it's being loaded in the browser.
Here's how I'm calling the API in JavaScript, and just for good measure, the way I'm loading it in HTML.
JavaScript:
Code: Select all
var sfs;
var config = {};
config.host = "127.0.0.1";
config.port = 8080;
config.debug = true;
config.useSSL = false;
sfs = new SFS2X.SmartFox(config);
HTML:
Code: Select all
<script type='text/javascript' src='libs/sfs2x-api-1.7.18.js'></script>
I'm also seeing this error with the API, not sure if this is causing SFS2X to appear undefined.
Code: Select all
Uncaught SyntaxError: no line break is allowed between 'throw' and its expression sfs2x-api-1.7.18.js:4301:16
UPDATE: I have double-checked if I use 1.7.18 with webpack if it does the same thing, it does not. Unfortunately, this particular project requires the api be loaded from an HTML script tag as webpack is not playing nicely with other files within the project.