title: IBM Worklight / Zxing- Uncaught ReferenceError: require is not defined barcodescanner.js:10
body: <p>I'm using worklight and zxing for my qr reader mobile app project. My problem is, i got this error after I run this app in my google chrome.</p>
  
  <pre><code>Uncaught ReferenceError: require is not defined barcodescanner.js:10
  </code></pre>
  
  <p>Error line 10 in barcodescanner.js</p>
  
  <pre><code>var exec = require("cordova/exec");
  </code></pre>
  
  <p>Even I included cordova file into index.html, the error message still occuring.</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
          &lt;head&gt;
              &lt;meta charset="UTF-8"&gt;
              &lt;title&gt;index&lt;/title&gt;
              &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"&gt;
              &lt;link rel="shortcut icon" href="images/favicon.png"&gt;
              &lt;link rel="apple-touch-icon" href="images/apple-touch-icon.png"&gt;
              &lt;link rel="stylesheet" href="css/jquery.mobile-1.3.1.css"&gt;
              &lt;link rel="stylesheet" href="css/custom.css"&gt;
              &lt;link rel="stylesheet" href="css/footer.css"&gt;
              &lt;!-- require.js:  data-main attribute tells require.js to load
               js/main.js after require.js loads. --&gt;
  
               &lt;script&gt;window.$ = window.jQuery = WLJQ;&lt;/script&gt;
               &lt;script src="js/vendor/phoneGap/cordova-1.6.0.js"&gt;&lt;/script&gt;
               &lt;script src="js/vendor/phoneGap/barcodescanner.js"&gt;&lt;/script&gt;
               &lt;script data-main="js/main" src="js/vendor/require/require.js"&gt;&lt;/script&gt;
  
          &lt;/head&gt;
          &lt;body&gt;
  
          &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Check my repo here: <a href="https://github.com/datomnurdin/worklight-mobile" rel="nofollow">https://github.com/datomnurdin/worklight-mobile</a></p>