No load path found

32 views
Skip to first unread message

Tom Burns

unread,
Mar 26, 2014, 5:16:34 PM3/26/14
to jsclas...@googlegroups.com
Hi -- this is my first day trying to use js class.  Looks cool, hope I can get it to work.  Unfortunately, I am not getting very far.  This is running in chrome. I have:

<script src="/pf4/static/lib/js_class/js_class_4.0.5/min/loader-browser.js"></script>

<script type="text/javascript">
   JS.require('JS.Class', function() {
        console.log("loaded js_class");
   });

  JS.packages(function() { with(this) {
file("/pf4/javascript/drag_drop.js")
.provides("SL.DragDrop")
.requires('JS.CLASS');
}});
</script>

later in the file there is:

<script type="text/javascript">
JS.require('SL.DragDrop', function() {
 console.log("loaded drag_drop");
});

</script>

I get the error:

Uncaught Error: No load path found for JS.CLASS followed by "loaded js_class" (what I print to the console after JS.CLASS is loaded).  What causes a "No load path found" error? Is the function provided to require called even if the load failed?

Also, is paid support available for js class?

Maynard Demmon

unread,
Mar 27, 2014, 3:43:34 AM3/27/14
to jsclas...@googlegroups.com
I think the problem you're seeing is from no JSCLASS_PATH being defined. I remember this being a bit mysterious when I first got JSClass working. Here is a minimal html doc that will load JS.Class for you and calls an init function. It assumes JSClass is in the directory ./src/js/jsclass relative to the HTML file.

<!doctype html><html><head>
<title>Minimal JSClass Example</title>
<script>
    var global = window; // Node.js compatibility.
    global.ROOT = global.ROOT || './src/js/';
    JSCLASS_PATH = global.ROOT + 'jsclass/min';
</script>
<script src="./src/js/jsclass/min/loader-browser.js"></script>
<script>
    JS.Packages(function() {with(this) {
        file(global.ROOT + 'jsclass/src/core.js').provides('JS.Class','JS.Module','JS.Singleton');
    }});
</script>
</head><body>
<script>
    JS.require('JS.Class', function() {this.init();});
   
    function init() {
        console.log('init called');
    }
</script>
</body></html>

I use JSClass in a web framework I work on so you might be able to get some relevant things out of that. It's on github at https://github.com/maynarddemmon/myt

James Coglan

unread,
Apr 22, 2014, 6:04:46 AM4/22/14
to jsclas...@googlegroups.com
On 26 March 2014 21:16, Tom Burns <to...@schoolloop.com> wrote:
  JS.packages(function() { with(this) {
file("/pf4/javascript/drag_drop.js")
.provides("SL.DragDrop")
.requires('JS.CLASS');
}});

I'm really sorry for the late reply, I've had too much on my plate this year. The error here is that you've used 'JS.CLASS' when the actual name of the dependency is 'JS.Class'. JavaScript reference names are case-sensitive.

I'm afraid I'm not able to offer paid support, but thanks for asking.

Cheers,
James 
Reply all
Reply to author
Forward
0 new messages