Note: Do not put your goog.require() statements in the same script tag as the entry point to code that uses the goog.required functions or classes. A goog.require() call adds code to the document after the script tag containing the call.
So
<script>
goog.require('goog.dom');
console.log(goog.dom);
</script>
prints undefined
. But
<script>
goog.require('goog.dom');
</script>
<script>
console.log(goog.dom);
</script>
or
<script>
goog.require('goog.dom');
addEventListener('load', function() {
console.log(goog.dom);
});
</script>
prints an Object.
FYI, there are other possible workflows. For example, the closurebuilder.py script can help to load all the required files ahead of time.