Uncaught ReferenceError: X is not defined

James West picture James West · Jul 13, 2011 · Viewed 12.5k times · Source

So I am digging through the WebOS enyo framework and am getting very frustrated. I am currently getting the following error in my log. I have been looking at the samples in the framework and I just can't seem to find where the error is stemming from. It's been over a decade since I have done any HTML or js and what I did back then was very basic stuff. Any help would be appreciated

Uncaught ReferenceError: Learning is not defined, index.html:9

Here is the very simple application, I am currently just attempting to get elements to appear on screen.

Index.html

<!doctype html />
<html>
<head>
    <title>Learning</title>
    <script src="../../enyo/1.0/framework/enyo.js" type="text/javascript"></script>
</head>
<body>
    <script type="text/javascript">
       new MyApps.Learning().renderInto(document.body);
</script>
</body>
</html>

Learning.js

enyo.kind({
    name: "MyApps.Learning",
    kind: enyo.VFlexBox,
    components: [
        { kind: "Scrim",
            layoutKind: "VFlexLayout",
            align: "center",
            pack: "center",
            components: [
                {kind: "SpinnerLarge"}
            ]
        }
    ]
});

depends.js

enyo.depends(
    "source/Learning.js",
    "css/Learning.css"
);

and just for the heck of it the

appinfo.json

file

{
    "id": "com.myapps.learning",
    "uiRevision": "2",
    "version": "1.0.0",
    "vendor": "kizelli",
    "type": "web",
    "main": "index.html",
    "title": "Learning"
}

Answer

diagonalbatman picture diagonalbatman · Jul 13, 2011

I think this is a problem in your appinfo.json file...

You hold the id as: com.myapps.learning

Yet you reference it as myapps.learning, try either removing the com. from appinfo.json or adding it to your kind definition and your index.html