0

My problem is very much like the Hem on windows problem: Uncaught module jqueryify not found

I can't deploy my spine mobile app to a android mobile devise using phonegap, it works perfectly in a browser (linux) but whenever I run it through eclipse on a android devise (various versions tested) I recieve:

06-17 18:39:36.878: E/Web Console(5976): ReferenceError: Can't find variable: require at file:///android_asset/www/index.html:9 

Which is referencing:

<!DOCTYPE html>
<html>
<head>
  <meta charset=utf-8>
  <title>App</title>
  <link rel="stylesheet" href="/application.css" type="text/css" charset="utf-8">
  <script src="/application.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
    var jQuery  = require("jqueryify"); //REFERENCED LINE 9
    var exports = this;
    jQuery(function(){
      var App = require("index");
      exports.app = new App({el: $("body")});      
    });
  </script>
</head>
<body>
</body>
</html>

I have installed the dependencies through npm and also built it using Hem, I'm kind of lost to what the problem might be.

Any ideas why this might be happening?

** EDIT **

The problem was the .js file was not being found, needed:

<script src="./application.js" type="text/javascript" charset="utf-8"></script> 

NOTICE THE '.' in the javascript file src att.

Community
  • 1
  • 1
Darcbar
  • 888
  • 1
  • 8
  • 25

1 Answers1

0

The error specifically means that the require function is undefined when it executes your inline script. Since require isn't a built-in part of browser JavaScript, that means whatever code (presumably a module-loader library) should be providing it either isn't getting executed or is failing. Given your code, that would have to be somewhere in application.js.

ebohlman
  • 14,795
  • 5
  • 33
  • 35