title: Import .jsm file in Firefox Extension (with add-on sdk)
body: <p>I'm trying to import a .jsm file (from <a href="https://github.com/nmaier/WebSocketServer.jsm" rel="nofollow">This github</a>) called "WebSocketServer.jsm" in my Firefox extension. The situation in the follow:</p>
  
  <ul>
  <li>The .jsm file is in a directory called modules with this path:</li>
  </ul>
  
  <blockquote>
    <p><code>root_of_extension/modules/WebSocketServer.jsm</code></p>
  </blockquote>
  
  <ul>
  <li>I've added to my chrome.manifest file this line:</li>
  </ul>
  
  <blockquote>
    <p><code>resource external_components modules/</code></p>
  </blockquote>
  
  <ul>
  <li>I've insert in my code the commend to import the file:</li>
  </ul>
  
  <blockquote>
    <p>Cu.import("resource://external_components/WebSocketServer.jsm");</p>
  </blockquote>
  
  <p>The problem is that from console I see the following error</p>
  
  <pre><code>console.error: 
  Object
  - message = Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXPCComponents_Utils.import]
  - fileName = undefined
  - lineNumber = 6
  - stack = @undefined:6:undefined|CuddlefishLoader/options&lt;.load@resource://gre/modules/commonjs/sdk/loader/cuddlefish.js:129:9|run@resource://gre/modules
  /commonjs/sdk/addon/runner.js:149:1|startup/&lt;@resource://gre/modules/commonjs/sdk/addon/runner.js:113:7|resolve@resource://gre/modules/commonjs
  /sdk/core/promise.js:118:11|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/
  promise.js:43:43|then@resource://gre/modules/commonjs/sdk/core/promise.js:153:9|resolve@resource://gre/modules/commonjs/sdk/core/
  promise.js:185:11|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/
  promise.js:43:43|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:185:11|resolve@resource://gre/modules/commonjs/sdk/core/
  promise.js:118:11|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/
  promise.js:43:43|then@resource://gre/modules/commonjs/sdk/core/promise.js:153:9|resolve@resource://gre/modules/commonjs/sdk/core/
  promise.js:185:11|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/
  promise.js:43:43|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:185:11|resolve@resource://gre/modules/commonjs/sdk/core/
  promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/promise.js:43:43|resolve@resource://gre/modules/commonjs/sdk/core/
  promise.js:185:11|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/
  promise.js:43:43|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:185:11|resolve@resource://gre/modules/commonjs/sdk/core/
  promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/promise.js:43:43|resolve@resource://gre/modules/commonjs/sdk/core/
  promise.js:185:11|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118:11|then@resource://gre/modules/commonjs/sdk/core/
  promise.js:43:43|resolve@resource://gre/modules/commonjs/sdk/core/promise.js:185:11|readAsync/&lt;@resource://gre/modules/commonjs/
  sdk/net/url.js:49:9|NetUtil_asyncOpen/&lt;.onStopRequest@resource://gre/modules/NetUtil.jsm:137:17|
  - toString = function () /* use strict */ toString
  </code></pre>
  
  <p>Line 6 in the "Cu.import" line. Do you have any ideas?</p>