title: Cordova Uncaught TypeError: Cannot set property 'require' of undefined
body: <p>All,</p>
  
  <p>Could you please help me with following. I am trying to access the camera API using cordova. I have created the project using cordova cli. My config.xml has this option added to allow the camera plugin which is also installed using cordova cli.</p>
  
  <pre><code>&lt;feature name="Camera"&gt;
  &lt;param name="android-package" value="org.apache.cordova.camera.CameraLauncher" /&gt;
  &lt;/feature&gt;
  </code></pre>
  
  <p>When I click the camera Button, I find the navigator.camera object as undefined. I have tried it on couple of phones and it seems to be the same issue. I tried remote debugging using chrome and it also shows the camera object as undefined.</p>
  
  <p>Cordova.js load fails with following object as undefined</p>
  
  <p>Uncaught TypeError: Cannot set property 'require' of undefined (cordova.js)</p>
  
  <pre><code>//Export for use in node
  if (typeof module === "object" &amp;&amp; typeof require === "function") {
    module.exports.require = require;
    module.exports.define = define;
   }
  </code></pre>
  
  <p>Cordova.js version is 3.7.1 .</p>
  
  <p>Please note :Commenting these 3 lines from Cordova.js in platform_www seems to fix the issue. But i am wondering if someone can help suggest whats wrong here. Modifying the lib is the last option.</p>