Google closure - goog.require could not find goog.structs.PriorityQueue

274 Views Asked by At

I'm trying to use the PriorityQueue functionality provided by Google Closure, but I can't seem to be able to figure out how to do it without using the Closure Compiler. Since I'm not using any custom modules, it seems that I shouldn't need to use the Compiler.

My folder structure is as follows:

/Project/html/index.html
/Project/ThirdParty/closure-library

My index.html file contains:

<html>
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <script type="text/javascript" src="../ThirdParty/closure-library/closure/goog/base.js"></script>
    <script>
        goog.require('goog.structs');
        goog.require('goog.structs.PriorityQueue');
    </script>
</head>
<body></body>
</html>

The above however gives me the following:

goog.require could not find: goog.structs
goog.require could not find: goog.structs.PriorityQueue

I'm a bit at a loss as to why that happens as my code seems to be in line with the example given at https://developers.google.com/closure/library/docs/gettingstarted

1

There are 1 best solutions below

2
John On

How did you retrieve the library? If you "npm install" you should have a deps.js file next to base.js which should be everything you need.