0

I'm using ExtJS 5.0.1 with Sencha Cmd to build a production version:

sencha app build -c production

I'm serving Socket.IO libraries directly from my NodeJS HTTP server and referencing them in the ExtJS app.json file:

    "js": [
    {
        "path":"/socket.io/socket.io.js"
    }
    ,...]

Then in my code, I'm calling the global io():

Ext.define('MyController',{
    extends:'Ext.app.ViewController',

    myFunction:function(){
        var socket = io();
        // do something with socket
    }
};

This all works fine when viewing my project in the browser but my Sencha cmd build process fails with an error:

2014-10-17 17:07:44.457 phantomjs[12931:d07] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.
registering ready listener...
loading widget definitions...
rendering widgets...
== Unhandled Error ==
ReferenceError: Can'''t find variable: io

I'm sure this is a case of missing the blindingly simple, somewhere I define which globals Sencha should expect to have access to.

Much thanks in advance!

Duncan
  • 858
  • 1
  • 11
  • 29

1 Answers1

0

I'm unsure whether to remove this question for it's idiocy, but as a courtesy to those suffering the same mental deficiencies as I was I thought I'd leave this up.

The app.json file has some pretty good documentation, and if you read it, you'll find it you'll find that the file references need to be relative to the app.json file (mine was a) referencing a stream served from node and b) when I did change it to an actual file I was using absolute paths).

So after copying the contents of socket.io.js to resources/js/socket.io.js (relative to the app.json file) this worked:

    "js": [
    {
        "path":"resources/js/socket.io.js"
    }
Duncan
  • 858
  • 1
  • 11
  • 29